MCPcopy Create free account
hub / github.com/Samsung/UTopia / resize

Method resize

external/jsoncpp/jsoncpp.cpp:3312–3328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3310}
3311
3312void Value::resize(ArrayIndex newSize) {
3313 JSON_ASSERT_MESSAGE(type() == nullValue || type() == arrayValue,
3314 "in Json::Value::resize(): requires arrayValue");
3315 if (type() == nullValue)
3316 *this = Value(arrayValue);
3317 ArrayIndex oldSize = size();
3318 if (newSize == 0)
3319 clear();
3320 else if (newSize > oldSize)
3321 this->operator[](newSize - 1);
3322 else {
3323 for (ArrayIndex index = newSize; index < oldSize; ++index) {
3324 value_.map_->erase(index);
3325 }
3326 JSON_ASSERT(size() == newSize);
3327 }
3328}
3329
3330Value &Value::operator[](ArrayIndex index) {
3331 JSON_ASSERT_MESSAGE(

Callers 6

readFileFunction · 0.80
codePointToUTF8Function · 0.80
recoverFromErrorMethod · 0.80
valueToStringFunction · 0.80
unindentMethod · 0.80
safeGetEnvForWindowsMethod · 0.80

Calls 1

ValueClass · 0.50

Tested by 1

safeGetEnvForWindowsMethod · 0.64