MCPcopy Create free account
hub / github.com/catboost/catboost / Key

Method Key

library/cpp/json/json_reader.cpp:285–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283 }
284
285 bool Key(const char* str, rapidjson::SizeType length, bool copy) {
286 Y_ASSERT(copy);
287 auto& value = Access(S.top())[TStringBuf(str, length)];
288 if (Y_UNLIKELY(value.GetType() != JSON_UNDEFINED)) {
289#ifndef NDEBUG
290 ++S.top().DuplicateKeyCount;
291#endif
292 value.SetType(JSON_UNDEFINED);
293 }
294 S.emplace(&value);
295 if (!IsWithinStackBounds()) {
296 return false;
297 }
298 return true;
299 }
300
301 inline int GetDuplicateKeyCount() const {
302#ifdef NDEBUG

Callers

nothing calls this directly

Calls 4

AccessEnum · 0.50
GetTypeMethod · 0.45
SetTypeMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected