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

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

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

Definition at line 157 of file ImmutableArray.cs.

158 {
159 int length2 = items.Length;
160 Requires.Range(start >= 0 && start <= length2, "start");
161 Requires.Range(length >= 0 && start + length <= length2, "length");
162 Requires.NotNull(selector, "selector");
163 if (length == 0)
164 {
165 return Create<TResult>();
166 }
167 TResult[] array = new TResult[length];
168 for (int i = 0; i < array.Length; i++)
169 {
170 array[i] = selector(items[i + start], arg);
171 }
172 return new ImmutableArray<TResult>(array);
173 }

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