MCPcopy Create free account
hub / github.com/e2wugui/zeze / shrink

Method shrink

ZezeJava/ZezeJava/src/main/java/Zeze/Util/KVList.java:145–164  ·  view source on GitHub ↗
(int count)

Source from the content-addressed store, hash-verified

143 }
144
145 public void shrink(int count) {
146 Object[] buffer;
147 int n = this.count;
148 if (n <= 0) {
149 reset();
150 return;
151 }
152 if (count < n)
153 count = n;
154 if (count < (buffer = keys).length) {
155 Object[] buf = new Object[count];
156 System.arraycopy(buffer, 0, buf, 0, n);
157 keys = buf;
158 }
159 if (count < (buffer = values).length) {
160 Object[] buf = new Object[count];
161 System.arraycopy(buffer, 0, buf, 0, n);
162 values = buf;
163 }
164 }
165
166 public void shrink() {
167 shrink(0);

Callers 5

shrinkVectorMethod · 0.45
shrinkVectorMethod · 0.45
shrinkVectorMethod · 0.45
shrinkVectorMethod · 0.45
shrinkVectorMethod · 0.45

Calls 1

resetMethod · 0.95

Tested by

no test coverage detected