Fix folly::dynamic ordering comparison operator bug for Type::INT64 vs Type::DOUBLE
Summary: Fixes the bug referenced in the base commit of this stack. Given that `folly::dynamic(1) == folly::dynamic(1.0)` returns true, `folly::dynamic(1) < folly::dynamic(1.0)` should return false to maintain ordering properties. Regarding the PrintTo test change - the keys in the json map are ordered - so now the numeric ordering behavior kicks in and order is changed. If we really wanted to we could use a custom comparator for when `json::serialization_opts::sort_keys == true` but this option I'm guessing is only for easing human consumption, and json keys of float-like things are probably not common so complicating the code may not be warranted. Reviewed By: Gownta Differential Revision: D33465565 fbshipit-source-id: 21859a1b0e63cc8c3d0c002f3478baae1cf7fc18
Showing
Please register or sign in to comment