Count matching keys as unsigned in the json_view access test

The conditional added 1 or 0 as int to a std::size_t, which GCC rejects
with -Werror=sign-conversion (ci_test_standards_gcc).

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-18 13:27:02 +02:00
1 parent 1b3cb9df75
commit 8abbc36d7d
1 file changed
+1 -1
+1 -1
View File
@@ -734,7 +734,7 @@ void check_access(const ordered_json_view& v, const ordered_json& j)
std::size_t occurrences = 0;
for (auto other = v.begin(); other != v.end(); ++other)
{
occurrences += other.key() == it.key() ? 1 : 0;
occurrences += other.key() == it.key() ? 1u : 0u;
}
CHECK(v.count(key) == occurrences);
// lookups find the first member with the key, which is this one if