MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / resize

Method resize

json/jsoncpp.cpp:3409–3425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3407}
3408
3409void Value::resize(ArrayIndex newSize) {
3410 JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue,
3411 "in Json::Value::resize(): requires arrayValue");
3412 if (type_ == nullValue)
3413 *this = Value(arrayValue);
3414 ArrayIndex oldSize = size();
3415 if (newSize == 0)
3416 clear();
3417 else if (newSize > oldSize)
3418 this->operator[](newSize - 1);
3419 else {
3420 for (ArrayIndex index = newSize; index < oldSize; ++index) {
3421 value_.map_->erase(index);
3422 }
3423 JSON_ASSERT(size() == newSize);
3424 }
3425}
3426
3427Value& Value::operator[](ArrayIndex index) {
3428 JSON_ASSERT_MESSAGE(

Callers 8

initMethod · 0.80
read_into_vecMethod · 0.80
InitializeHeaderMethod · 0.80
ReadStringTableMethod · 0.80
codePointToUTF8Function · 0.80
recoverFromErrorMethod · 0.80
valueToStringFunction · 0.80
unindentMethod · 0.80

Calls 4

eraseMethod · 0.80
ValueClass · 0.70
sizeFunction · 0.50
operator[]Method · 0.45

Tested by

no test coverage detected