Skip to content

Commit

Permalink
Addressed some VS code analysis warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 14, 2024
1 parent 5baaf4d commit eba9be1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions include/jsoncons/json_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,10 +1292,7 @@ namespace jsoncons {
{
if (length > 0)
{
auto first = items;
auto last = first + length;

std::sort(first, last, compare1);
std::sort(items, items+length, compare1);

std::size_t count = 1;
for (std::size_t i = 1; i < length; ++i)
Expand All @@ -1311,15 +1308,13 @@ namespace jsoncons {
}
}

last = first+count;
std::sort(first, last, compare2);
std::sort(items, items+count, compare2);

members_.reserve(count);

//for (auto it = first; it != last; ++it)
for (std::size_t i = 0; i < count; ++i)
{
members_.emplace_back(std::move(first[i].name), std::move(first[i].value));
members_.emplace_back(std::move(items[i].name), std::move(items[i].value));
}
}
}
Expand Down

0 comments on commit eba9be1

Please sign in to comment.