MCPcopy Index your code
hub / github.com/davidgiven/luje / move

Method move

lib/java/lang/AbstractStringBuilder.java:364–384  ·  view source on GitHub ↗
(int size, int index)

Source from the content-addressed store, hash-verified

362 }
363
364 private void move(int size, int index) {
365 int newSize;
366 if (value.length - count >= size) {
367 if (!shared) {
368 System.arraycopy(value, index, value, index + size, count
369 - index); // index == count case is no-op
370 return;
371 }
372 newSize = value.length;
373 } else {
374 int a = count + size, b = (value.length << 1) + 2;
375 newSize = a > b ? a : b;
376 }
377
378 char[] newData = new char[newSize];
379 System.arraycopy(value, 0, newData, 0, index);
380 // index == count case is no-op
381 System.arraycopy(value, index, newData, index + size, count - index);
382 value = newData;
383 shared = false;
384 }
385
386 final void replace0(int start, int end, String string) {
387 if (start >= 0) {

Callers 2

insert0Method · 0.95
replace0Method · 0.95

Calls 1

arraycopyMethod · 0.95

Tested by

no test coverage detected