Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IndexOf() [8/8]

int System.Collections.Immutable.ImmutableArray< T >.IndexOf ( T item,
int startIndex,
int count,
IEqualityComparer< T >? equalityComparer )
inline

Implements System.Collections.Immutable.IImmutableList< T >.

Definition at line 953 of file ImmutableArray.cs.

954 {
956 immutableArray.ThrowNullRefIfNotInitialized();
957 if (count == 0 && startIndex == 0)
958 {
959 return -1;
960 }
961 Requires.Range(startIndex >= 0 && startIndex < immutableArray.Length, "startIndex");
962 Requires.Range(count >= 0 && startIndex + count <= immutableArray.Length, "count");
965 {
967 }
968 for (int i = startIndex; i < startIndex + count; i++)
969 {
970 if (equalityComparer.Equals(immutableArray.array[i], item))
971 {
972 return i;
973 }
974 }
975 return -1;
976 }
int IList. IndexOf(object value)
Definition Array.cs:1228

References System.count, System.Default, System.Array.IndexOf(), System.item, System.Collections.Immutable.Requires.Range(), and System.startIndex.