MCPcopy Create free account
hub / github.com/Kitware/VTK / resize

Method resize

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:3344–3361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3342}
3343
3344void Value::resize(ArrayIndex newSize) {
3345 JSON_ASSERT_MESSAGE(type() == nullValue || type() == arrayValue,
3346 "in Json::Value::resize(): requires arrayValue");
3347 if (type() == nullValue)
3348 *this = Value(arrayValue);
3349 ArrayIndex oldSize = size();
3350 if (newSize == 0)
3351 clear();
3352 else if (newSize > oldSize)
3353 for (ArrayIndex i = oldSize; i < newSize; ++i)
3354 (*this)[i];
3355 else {
3356 for (ArrayIndex index = newSize; index < oldSize; ++index) {
3357 value_.map_->erase(index);
3358 }
3359 JSON_ASSERT(size() == newSize);
3360 }
3361}
3362
3363Value& Value::operator[](ArrayIndex index) {
3364 JSON_ASSERT_MESSAGE(

Callers 15

NewMethod · 0.45
NewMethod · 0.45
addStepMethod · 0.45
populateItemMethod · 0.45
populateItemMethod · 0.45
operator()Method · 0.45
XDMF_ERROR_WRAP_STARTFunction · 0.45
chunkMethod · 0.45
interlaceMethod · 0.45
controllerSplittingMethod · 0.45
ConvertToUpperMethod · 0.45

Calls 5

typeEnum · 0.50
ValueFunction · 0.50
sizeFunction · 0.50
clearFunction · 0.50
eraseMethod · 0.45

Tested by 2

VectorDiffMethod · 0.36
PointMatchingWorkerMethod · 0.36