MCPcopy Index your code
hub / github.com/processing/processing / index

Method index

core/src/processing/data/IntList.java:417–433  ·  view source on GitHub ↗

Return the first index of a particular value.

(int what)

Source from the content-addressed store, hash-verified

415
416 /** Return the first index of a particular value. */
417 public int index(int what) {
418 /*
419 if (indexCache != null) {
420 try {
421 return indexCache.get(what);
422 } catch (Exception e) { // not there
423 return -1;
424 }
425 }
426 */
427 for (int i = 0; i < count; i++) {
428 if (data[i] == what) {
429 return i;
430 }
431 }
432 return -1;
433 }
434
435
436 // !!! TODO this is not yet correct, because it's not being reset when

Callers 1

removeValueMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected