MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / resize

Method resize

Source/JSON/jsoncpp.cpp:3042–3058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3040}
3041
3042void Value::resize(ArrayIndex newSize) {
3043 JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue,
3044 "in Json::Value::resize(): requires arrayValue");
3045 if (type_ == nullValue)
3046 *this = Value(arrayValue);
3047 ArrayIndex oldSize = size();
3048 if (newSize == 0)
3049 clear();
3050 else if (newSize > oldSize)
3051 (*this)[newSize - 1];
3052 else {
3053 for (ArrayIndex index = newSize; index < oldSize; ++index) {
3054 value_.map_->erase(index);
3055 }
3056 assert(size() == newSize);
3057 }
3058}
3059
3060Value& Value::operator[](ArrayIndex index) {
3061 JSON_ASSERT_MESSAGE(

Callers 15

GetJoystickInputsMethod · 0.45
AddPairToHashFunction · 0.45
GetMouseInputsMethod · 0.45
InputMethod · 0.45
OpenJoystickMethod · 0.45
AddGameControllerDBFunction · 0.45
GetKeyboardInputsMethod · 0.45
InitKeyTranslatorFunction · 0.45
FindPathMethod · 0.45
AddFadingAnimationMethod · 0.45
AddLayerMethod · 0.45
AddBloodLineMethod · 0.45

Calls 4

ValueClass · 0.70
sizeFunction · 0.50
clearFunction · 0.50
eraseMethod · 0.45

Tested by 2

TestMainFunction · 0.36
GenerateDataMethod · 0.36