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

Method operator==

library/cpp/json/writer/json_value.cpp:932–956  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

930 }
931
932 bool TJsonValue::operator==(const TJsonValue& rhs) const {
933 switch (Type) {
934 case JSON_UNDEFINED:
935 return (rhs.GetType() == JSON_UNDEFINED);
936 case JSON_NULL:
937 return rhs.IsNull();
938 case JSON_BOOLEAN:
939 return (rhs.IsBoolean() && Value.Boolean == rhs.Value.Boolean);
940 case JSON_INTEGER:
941 return (rhs.IsInteger() && GetInteger() == rhs.GetInteger());
942 case JSON_UINTEGER:
943 return (rhs.IsUInteger() && GetUInteger() == rhs.GetUInteger());
944 case JSON_STRING:
945 return (rhs.IsString() && Value.String == rhs.Value.String);
946 case JSON_DOUBLE:
947 return (rhs.IsDouble() && fabs(GetDouble() - rhs.GetDouble()) <= FLT_EPSILON);
948 case JSON_MAP:
949 return AreJsonMapsEqual(*this, rhs);
950 case JSON_ARRAY:
951 return AreJsonArraysEqual(*this, rhs);
952 default:
953 Y_ASSERT(false && "Unknown type.");
954 return false;
955 }
956 }
957
958 void TJsonValue::SwapWithUndefined(TJsonValue& output) noexcept {
959 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