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

Method index

core/src/processing/data/StringList.java:442–457  ·  view source on GitHub ↗

Return the first index of a particular value.

(String what)

Source from the content-addressed store, hash-verified

440
441 /** Return the first index of a particular value. */
442 public int index(String what) {
443 if (what == null) {
444 for (int i = 0; i < count; i++) {
445 if (data[i] == null) {
446 return i;
447 }
448 }
449 } else {
450 for (int i = 0; i < count; i++) {
451 if (what.equals(data[i])) {
452 return i;
453 }
454 }
455 }
456 return -1;
457 }
458
459
460 // !!! TODO this is not yet correct, because it's not being reset when

Callers 1

removeValueMethod · 0.95

Calls 1

equalsMethod · 0.45

Tested by

no test coverage detected