From 315df12fbe5b9b7e2908dbe1d3aeff37ad18430b Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 5 May 2023 14:34:32 +0200 Subject: [PATCH] Favor passing `Tag` as value since it's just `uint32` under the hood --- Source/Engine/Level/Tags.cpp | 4 ++-- Source/Engine/Level/Tags.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Level/Tags.cpp b/Source/Engine/Level/Tags.cpp index b9b3b1f79..7f287022f 100644 --- a/Source/Engine/Level/Tags.cpp +++ b/Source/Engine/Level/Tags.cpp @@ -55,7 +55,7 @@ Tag Tags::Get(const StringView& tagName) return tag; } -bool Tags::HasTag(const Array& list, const Tag& tag) +bool Tags::HasTag(const Array& list, const Tag tag) { if (tag.Index == 0) return false; @@ -69,7 +69,7 @@ bool Tags::HasTag(const Array& list, const Tag& tag) return false; } -bool Tags::HasTagExact(const Array& list, const Tag& tag) +bool Tags::HasTagExact(const Array& list, const Tag tag) { if (tag.Index == 0) return false; diff --git a/Source/Engine/Level/Tags.h b/Source/Engine/Level/Tags.h index 03b09a1fc..b15b5087f 100644 --- a/Source/Engine/Level/Tags.h +++ b/Source/Engine/Level/Tags.h @@ -99,7 +99,7 @@ public: /// The tags list to use. /// The tag to check. /// True if given tag is contained by the list of tags. Returns false for empty list. - static bool HasTag(const Array& list, const Tag& tag); + static bool HasTag(const Array& list, const Tag tag); /// /// Checks if the list of tags contains a given tag (exact match). For example, HasTag({"A.B"}, "A") returns false, for parents check use HasTag. @@ -107,7 +107,7 @@ public: /// The tags list to use. /// The tag to check. /// True if given tag is contained by the list of tags. Returns false for empty list. - static bool HasTagExact(const Array& list, const Tag& tag); + static bool HasTagExact(const Array& list, const Tag tag); /// /// Checks if the list of tags contains any of the given tags (including parent tags check). For example, HasAny({"A.B", "C"}, {"A"}) returns true, for exact check use HasAnyExact.