MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / move

Method move

vm/JavaAPI/src/java/lang/StringBuilder.java:342–361  ·  view source on GitHub ↗
(int size, int index)

Source from the content-addressed store, hash-verified

340 }
341
342 private void move(int size, int index) {
343 int newCount;
344 if (value.length - count >= size) {
345 //if (!shared) {
346 // index == count case is no-op
347 System.arraycopy(value, index, value, index + size, count - index);
348 return;
349 /*}
350 newCount = value.length;*/
351 } else {
352 newCount = Math.max(count + size, value.length*2 + 2);
353 }
354
355 char[] newData = new char[newCount];
356 System.arraycopy(value, 0, newData, 0, index);
357 // index == count case is no-op
358 System.arraycopy(value, index, newData, index + size, count - index);
359 value = newData;
360 //shared = false;
361 }
362
363 java.lang.StringBuilder insert(int index, char[] chars){
364 if (chars.length != 0) {

Callers 6

insertMethod · 0.95
jiFunction · 0.45
updateMethod · 0.45
retrolambdaMethod · 0.45
buildMethod · 0.45

Calls 2

arraycopyMethod · 0.95
maxMethod · 0.95

Tested by

no test coverage detected