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

◆ CreateRange< TSource, TResult >() [2/2]

static ImmutableArray< TResult > System.Collections.Immutable.ImmutableArray< T >.CreateRange< TSource, TResult > ( ImmutableArray< TSource > items,
int start,
int length,
Func< TSource, TResult > selector )
inlinestatic

Definition at line 123 of file ImmutableArray.cs.

124 {
125 int length2 = items.Length;
126 Requires.Range(start >= 0 && start <= length2, "start");
127 Requires.Range(length >= 0 && start + length <= length2, "length");
128 Requires.NotNull(selector, "selector");
129 if (length == 0)
130 {
131 return Create<TResult>();
132 }
133 TResult[] array = new TResult[length];
134 for (int i = 0; i < array.Length; i++)
135 {
136 array[i] = selector(items[i + start]);
137 }
138 return new ImmutableArray<TResult>(array);
139 }

References System.Collections.Immutable.ImmutableArray< T >.array, System.length, System.length2, System.Collections.Immutable.Requires.Range(), System.Linq.selector, and System.start.