36 bool isClose(
double x,
double y,
double tolerance) {
37 return std::abs(x - y) <= tolerance;
48 const auto& integ = obj1.
isInt() ? obj1 : obj2;
49 const auto& doubl = obj1.
isInt() ? obj2 : obj1;
52 return isClose(to<double>(integ.asInt()), doubl.asDouble(), tolerance);
57 switch (obj1.
type()) {
58 case dynamic::Type::NULLT:
60 case dynamic::Type::ARRAY:
64 for (
auto i1 = obj1.
begin(), i2 = obj2.
begin(); i1 != obj1.
end();
71 case dynamic::Type::BOOL:
73 case dynamic::Type::DOUBLE:
75 case dynamic::Type::INT64:
77 case dynamic::Type::OBJECT:
83 obj1.
items().begin(), obj1.
items().end(), [&](
const auto& item) {
84 const auto& value1 = item.second;
85 const auto value2 = obj2.
get_ptr(item.first);
dynamic parseJson(StringPiece range)
bool compareJsonWithTolerance(StringPiece json1, StringPiece json2, double tolerance)
—— Concurrent Priority Queue Implementation ——
FOLLY_ALWAYS_INLINE void assume_unreachable()
std::string asString() const
IterableProxy< const_item_iterator > items() const
const_iterator begin() const
bool compareJson(StringPiece json1, StringPiece json2)
bool compareDynamicWithTolerance(const dynamic &obj1, const dynamic &obj2, double tolerance)
const_iterator end() const
const dynamic * get_ptr(json_pointer const &) const &