Rename the key index's match callback so Flawfinder doesn't read it as std::equal

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-22 09:42:44 +02:00
1 parent 4cde5e39b9
commit f5cb977387
2 files changed
+8 -8

No files matched your search

+4 -4
View File
@@ -344,9 +344,9 @@ class object_key_index
rebuild(size); rebuild(size);
} }
/// @return the position of the element with @a hash for which @a equal(position) holds, or npos /// @return the position of the element with @a hash for which @a matches(position) holds, or npos
template<typename Equal> template<typename Matches>
std::size_t find(const std::size_t hash, Equal equal) const std::size_t find(const std::size_t hash, Matches matches) const
{ {
for (std::size_t slot = hash & mask;; slot = (slot + 1) & mask) for (std::size_t slot = hash & mask;; slot = (slot + 1) & mask)
{ {
@@ -355,7 +355,7 @@ class object_key_index
{ {
return npos; return npos;
} }
if (hashes[entry - 1] == hash && equal(entry - 1)) if (hashes[entry - 1] == hash && matches(entry - 1))
{ {
return entry - 1; return entry - 1;
} }
+4 -4
View File
@@ -15277,9 +15277,9 @@ class object_key_index
rebuild(size); rebuild(size);
} }
/// @return the position of the element with @a hash for which @a equal(position) holds, or npos /// @return the position of the element with @a hash for which @a matches(position) holds, or npos
template<typename Equal> template<typename Matches>
std::size_t find(const std::size_t hash, Equal equal) const std::size_t find(const std::size_t hash, Matches matches) const
{ {
for (std::size_t slot = hash & mask;; slot = (slot + 1) & mask) for (std::size_t slot = hash & mask;; slot = (slot + 1) & mask)
{ {
@@ -15288,7 +15288,7 @@ class object_key_index
{ {
return npos; return npos;
} }
if (hashes[entry - 1] == hash && equal(entry - 1)) if (hashes[entry - 1] == hash && matches(entry - 1))
{ {
return entry - 1; return entry - 1;
} }