Favor passing Tag as value since it's just uint32 under the hood

This commit is contained in:
Wojtek Figat
2023-05-05 14:34:32 +02:00
parent de1ba2de6f
commit 315df12fbe
2 changed files with 4 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ Tag Tags::Get(const StringView& tagName)
return tag;
}
bool Tags::HasTag(const Array<Tag>& list, const Tag& tag)
bool Tags::HasTag(const Array<Tag>& list, const Tag tag)
{
if (tag.Index == 0)
return false;
@@ -69,7 +69,7 @@ bool Tags::HasTag(const Array<Tag>& list, const Tag& tag)
return false;
}
bool Tags::HasTagExact(const Array<Tag>& list, const Tag& tag)
bool Tags::HasTagExact(const Array<Tag>& list, const Tag tag)
{
if (tag.Index == 0)
return false;

View File

@@ -99,7 +99,7 @@ public:
/// <param name="list">The tags list to use.</param>
/// <param name="tag">The tag to check.</param>
/// <returns>True if given tag is contained by the list of tags. Returns false for empty list.</returns>
static bool HasTag(const Array<Tag>& list, const Tag& tag);
static bool HasTag(const Array<Tag>& list, const Tag tag);
/// <summary>
/// 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:
/// <param name="list">The tags list to use.</param>
/// <param name="tag">The tag to check.</param>
/// <returns>True if given tag is contained by the list of tags. Returns false for empty list.</returns>
static bool HasTagExact(const Array<Tag>& list, const Tag& tag);
static bool HasTagExact(const Array<Tag>& list, const Tag tag);
/// <summary>
/// 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.