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

◆ RemoveAll() [1/2]

ImmutableArray< T > System.Collections.Immutable.ImmutableArray< T >.RemoveAll ( Predicate< T > match)
inline

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

Definition at line 1247 of file ImmutableArray.cs.

1248 {
1249 ImmutableArray<T> result = this;
1250 result.ThrowNullRefIfNotInitialized();
1251 Requires.NotNull(match, "match");
1252 if (result.IsEmpty)
1253 {
1254 return result;
1255 }
1256 List<int> list = null;
1257 for (int i = 0; i < result.array.Length; i++)
1258 {
1259 if (match(result.array[i]))
1260 {
1261 if (list == null)
1262 {
1263 list = new List<int>();
1264 }
1265 list.Add(i);
1266 }
1267 }
1268 if (list == null)
1269 {
1270 return result;
1271 }
1272 return result.RemoveAtRange(list);
1273 }

References System.list, and System.match.