MCPcopy Create free account
hub / github.com/catboost/catboost / operator==

Method operator==

library/cpp/json/ordered_maps/json_value_ordered.cpp:1008–1032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1006 }
1007
1008 bool TJsonValue::operator==(const TJsonValue& rhs) const {
1009 switch (Type) {
1010 case JSON_UNDEFINED:
1011 return (rhs.GetType() == JSON_UNDEFINED);
1012 case JSON_NULL:
1013 return rhs.IsNull();
1014 case JSON_BOOLEAN:
1015 return (rhs.IsBoolean() && Value.Boolean == rhs.Value.Boolean);
1016 case JSON_INTEGER:
1017 return (rhs.IsInteger() && GetInteger() == rhs.GetInteger());
1018 case JSON_UINTEGER:
1019 return (rhs.IsUInteger() && GetUInteger() == rhs.GetUInteger());
1020 case JSON_STRING:
1021 return (rhs.IsString() && Value.String == rhs.Value.String);
1022 case JSON_DOUBLE:
1023 return (rhs.IsDouble() && fabs(GetDouble() - rhs.GetDouble()) <= FLT_EPSILON);
1024 case JSON_MAP:
1025 return AreJsonMapsEqual(*this, rhs);
1026 case JSON_ARRAY:
1027 return AreJsonArraysEqual(*this, rhs);
1028 default:
1029 Y_ASSERT(false && "Unknown type.");
1030 return false;
1031 }
1032 }
1033
1034 void TJsonValue::SwapWithUndefined(TJsonValue& output) noexcept {
1035 if (Type == JSON_STRING) {

Callers

nothing calls this directly

Calls 15

fabsFunction · 0.85
GetIntegerFunction · 0.70
GetUIntegerFunction · 0.70
GetDoubleFunction · 0.70
AreJsonMapsEqualFunction · 0.70
AreJsonArraysEqualFunction · 0.70
GetTypeMethod · 0.45
IsNullMethod · 0.45
IsBooleanMethod · 0.45
IsIntegerMethod · 0.45
GetIntegerMethod · 0.45
IsUIntegerMethod · 0.45

Tested by

no test coverage detected