Declare the partner iterator in the loop initializer in diff_object_keys()

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-16 19:38:26 +02:00
1 parent f941cf7a7e
commit 2241af3297
2 files changed
+2 -4

No files matched your search

+1 -2
View File
@@ -7507,8 +7507,7 @@ public:
target_values.reserve(source.size());
std::size_t common = 0;
bool together = source.size() == target.size();
auto partner = target.cbegin();
for (auto it = source.cbegin(); it != source.cend(); ++it)
for (auto it = source.cbegin(), partner = target.cbegin(); it != source.cend(); ++it)
{
if (together)
{
+1 -2
View File
@@ -37764,8 +37764,7 @@ public:
target_values.reserve(source.size());
std::size_t common = 0;
bool together = source.size() == target.size();
auto partner = target.cbegin();
for (auto it = source.cbegin(); it != source.cend(); ++it)
for (auto it = source.cbegin(), partner = target.cbegin(); it != source.cend(); ++it)
{
if (together)
{