Commit 05d3945f authored by Michael O'Farrell's avatar Michael O'Farrell Committed by Facebook Github Bot

Fix folly json to only sort properties of objects based on their key not value.

Reviewed By: yfeldblum

Differential Revision: D4386258

fbshipit-source-id: 23499267eb4390f0f40b3643760514cae1ca7838
parent 7895dc70
......@@ -113,7 +113,10 @@ private:
if (opts_.sort_keys) {
std::vector<std::pair<dynamic, dynamic>> items(
o.items().begin(), o.items().end());
std::sort(items.begin(), items.end());
std::sort(items.begin(), items.end(), [](auto const& a, auto const& b) {
// Only compare keys. No ordering among identical keys.
return a.first < b.first;
});
printKVPairs(items.begin(), items.end());
} else {
printKVPairs(o.items().begin(), o.items().end());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment