MCPcopy Create free account
hub / github.com/cuberite/cuberite / resize

Method resize

lib/jsoncpp/src/lib_json/json_value.cpp:959–980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

957}
958
959void
960Value::resize( UInt newSize )
961{
962 JSON_ASSERT( type_ == nullValue || type_ == arrayValue );
963 if ( type_ == nullValue )
964 *this = Value( arrayValue );
965#ifndef JSON_VALUE_USE_INTERNAL_MAP
966 UInt oldSize = size();
967 if ( newSize == 0 )
968 clear();
969 else if ( newSize > oldSize )
970 (*this)[ newSize - 1 ];
971 else
972 {
973 for ( UInt index = newSize; index < oldSize; ++index )
974 value_.map_->erase( index );
975 assert( size() == newSize );
976 }
977#else
978 value_.array_->resize( newSize );
979#endif
980}
981
982
983Value &

Callers 15

codePointToUTF8Function · 0.80
recoverFromErrorMethod · 0.80
unindentMethod · 0.80
AddKeyNameMethod · 0.80
AddKeyCommentMethod · 0.80
CompressStringFunction · 0.80
UncompressStringFunction · 0.80
InitServerMethod · 0.80
Base64DecodeFunction · 0.80
Base64EncodeFunction · 0.80
AddReceivedDataMethod · 0.80
ParseItemMethod · 0.80

Calls 1

ValueClass · 0.50

Tested by

no test coverage detected