MCPcopy Index your code
hub / github.com/benfry/processing4 / removeValues

Method removeValues

core/src/processing/data/StringList.java:222–241  ·  view source on GitHub ↗
(String value)

Source from the content-addressed store, hash-verified

220
221 // Remove all instances of a particular value and return the count removed.
222 @SuppressWarnings("unused")
223 public int removeValues(String value) {
224 int ii = 0;
225 if (value == null) {
226 for (int i = 0; i < count; i++) {
227 if (data[i] != null) {
228 data[ii++] = data[i];
229 }
230 }
231 } else {
232 for (int i = 0; i < count; i++) {
233 if (!value.equals(data[i])) {
234 data[ii++] = data[i];
235 }
236 }
237 }
238 int removed = count - ii;
239 count = ii;
240 return removed;
241 }
242
243
244 // replace the first value that matches, return the index that was replaced

Callers

nothing calls this directly

Calls 1

equalsMethod · 0.45

Tested by

no test coverage detected