mirror of
https://github.com/nlohmann/json.git
synced 2026-10-18 12:08:12 +00:00
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:
1 file changed
+1
-1
@@ -734,7 +734,7 @@ void check_access(const ordered_json_view& v, const ordered_json& j)
|
|||||||
std::size_t occurrences = 0;
|
std::size_t occurrences = 0;
|
||||||
for (auto other = v.begin(); other != v.end(); ++other)
|
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);
|
CHECK(v.count(key) == occurrences);
|
||||||
// lookups find the first member with the key, which is this one if
|
// lookups find the first member with the key, which is this one if
|
||||||
|
|||||||
Reference in new issue
Block a user