| 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 |