MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / indexOf

Function indexOf

include/Array.h:764–781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762
763
764 int indexOf(ELEM_ inValue, Dynamic fromIndex = null())
765 {
766 int len = length;
767 int i = fromIndex==null() ? 0 : fromIndex->__ToInt();
768 ELEM_ *e = (ELEM_ *)mBase;
769 if (i < 0)
770 {
771 i += len;
772 if (i < 0) i = 0;
773 }
774 while(i<len)
775 {
776 if (hx::arrayElemEq(e[i],inValue))
777 return i;
778 i++;
779 }
780 return -1;
781 }
782
783 int lastIndexOf(ELEM_ inValue, Dynamic fromIndex = null())
784 {

Callers 1

__indexOfFunction · 0.70

Calls 3

arrayElemEqFunction · 0.85
nullClass · 0.70
__ToIntMethod · 0.45

Tested by

no test coverage detected