MCPcopy Create free account
hub / github.com/9miao/CrossApp / resize

Function resize

scripting/javascript/spidermonkey-android/include/jsapi.h:348–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346 }
347
348 bool resize(size_t newLength) {
349 size_t oldLength = vector.length();
350 if (newLength <= oldLength) {
351 vector.shrinkBy(oldLength - newLength);
352 return true;
353 }
354 if (!vector.growByUninitialized(newLength - oldLength))
355 return false;
356 makeRangeGCSafe(oldLength);
357 return true;
358 }
359
360 void clear() { vector.clear(); }
361

Callers

nothing calls this directly

Calls 4

makeRangeGCSafeFunction · 0.70
lengthMethod · 0.45
shrinkByMethod · 0.45
growByUninitializedMethod · 0.45

Tested by

no test coverage detected