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:
2 files changed
+8
-8
No files matched your search
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+4
-4
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user