From f5cb97738722872b58cda1459db6b08cab55beb5 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 22 Oct 2026 09:42:44 +0200 Subject: [PATCH] Rename the key index's match callback so Flawfinder doesn't read it as std::equal Signed-off-by: Niels Lohmann --- include/nlohmann/detail/input/json_sax.hpp | 8 ++++---- single_include/nlohmann/json.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/nlohmann/detail/input/json_sax.hpp b/include/nlohmann/detail/input/json_sax.hpp index d6a8a2cfd..c8a3da5c3 100644 --- a/include/nlohmann/detail/input/json_sax.hpp +++ b/include/nlohmann/detail/input/json_sax.hpp @@ -344,9 +344,9 @@ class object_key_index rebuild(size); } - /// @return the position of the element with @a hash for which @a equal(position) holds, or npos - template - std::size_t find(const std::size_t hash, Equal equal) const + /// @return the position of the element with @a hash for which @a matches(position) holds, or npos + template + std::size_t find(const std::size_t hash, Matches matches) const { for (std::size_t slot = hash & mask;; slot = (slot + 1) & mask) { @@ -355,7 +355,7 @@ class object_key_index { return npos; } - if (hashes[entry - 1] == hash && equal(entry - 1)) + if (hashes[entry - 1] == hash && matches(entry - 1)) { return entry - 1; } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 7160b49d1..caefe88fc 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -15277,9 +15277,9 @@ class object_key_index rebuild(size); } - /// @return the position of the element with @a hash for which @a equal(position) holds, or npos - template - std::size_t find(const std::size_t hash, Equal equal) const + /// @return the position of the element with @a hash for which @a matches(position) holds, or npos + template + std::size_t find(const std::size_t hash, Matches matches) const { for (std::size_t slot = hash & mask;; slot = (slot + 1) & mask) { @@ -15288,7 +15288,7 @@ class object_key_index { return npos; } - if (hashes[entry - 1] == hash && equal(entry - 1)) + if (hashes[entry - 1] == hash && matches(entry - 1)) { return entry - 1; }