MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / resize

Method resize

AgentBench.old/src/tasks/card_game/logic/src/jsoncpp/jsoncpp.cpp:3394–3410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3392}
3393
3394void Value::resize(ArrayIndex newSize) {
3395 JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue,
3396 "in Json::Value::resize(): requires arrayValue");
3397 if (type_ == nullValue)
3398 *this = Value(arrayValue);
3399 ArrayIndex oldSize = size();
3400 if (newSize == 0)
3401 clear();
3402 else if (newSize > oldSize)
3403 (*this)[newSize - 1];
3404 else {
3405 for (ArrayIndex index = newSize; index < oldSize; ++index) {
3406 value_.map_->erase(index);
3407 }
3408 JSON_ASSERT(size() == newSize);
3409 }
3410}
3411
3412Value& Value::operator[](ArrayIndex index) {
3413 JSON_ASSERT_MESSAGE(

Callers 11

AquaWarSDKMethod · 0.45
action_msg_checkerMethod · 0.45
read_jsonMethod · 0.45
to_jsonMethod · 0.45
to_jsonMethod · 0.45
codePointToUTF8Function · 0.45
recoverFromErrorMethod · 0.45
unindentMethod · 0.45
_setDatePickerDefaultsFunction · 0.45
initPageSlideFunction · 0.45
aa_Utilities_DialogFunction · 0.45

Calls 1

ValueClass · 0.50

Tested by

no test coverage detected