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

◆ LastIndexOf() [4/4]

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

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

Definition at line 1003 of file ImmutableArray.cs.

1004 {
1006 immutableArray.ThrowNullRefIfNotInitialized();
1007 if (startIndex == 0 && count == 0)
1008 {
1009 return -1;
1010 }
1011 Requires.Range(startIndex >= 0 && startIndex < immutableArray.Length, "startIndex");
1012 Requires.Range(count >= 0 && startIndex - count + 1 >= 0, "count");
1015 {
1017 }
1018 for (int num = startIndex; num >= startIndex - count + 1; num--)
1019 {
1020 if (equalityComparer.Equals(item, immutableArray.array[num]))
1021 {
1022 return num;
1023 }
1024 }
1025 return -1;
1026 }
static int LastIndexOf(Array array, object? value)
Definition Array.cs:1995

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