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

◆ ForEachWorker< TSource, TLocal >() [3/3]

static ParallelLoopResult System.Threading.Tasks.Parallel.ForEachWorker< TSource, TLocal > ( TSource[] array,
ParallelOptions parallelOptions,
Action< TSource > body,
Action< TSource, ParallelLoopState > bodyWithState,
Action< TSource, ParallelLoopState, long > bodyWithStateAndIndex,
Func< TSource, ParallelLoopState, TLocal, TLocal > bodyWithStateAndLocal,
Func< TSource, ParallelLoopState, long, TLocal, TLocal > bodyWithEverything,
Func< TLocal > localInit,
Action< TLocal > localFinally )
inlinestaticprivate

Definition at line 946 of file Parallel.cs.

947 {
948 int lowerBound = array.GetLowerBound(0);
949 int toExclusive = array.GetUpperBound(0) + 1;
950 if (body != null)
951 {
953 {
954 body(array[i]);
955 }, null, null, null, null);
956 }
957 if (bodyWithState != null)
958 {
959 return ForWorker<object>(lowerBound, toExclusive, parallelOptions, null, delegate(int i, ParallelLoopState state)
960 {
962 }, null, null, null);
963 }
964 if (bodyWithStateAndIndex != null)
965 {
966 return ForWorker<object>(lowerBound, toExclusive, parallelOptions, null, delegate(int i, ParallelLoopState state)
967 {
969 }, null, null, null);
970 }
971 if (bodyWithStateAndLocal != null)
972 {
973 return ForWorker(lowerBound, toExclusive, parallelOptions, null, null, (int i, ParallelLoopState state, TLocal local) => bodyWithStateAndLocal(array[i], state, local), localInit, localFinally);
974 }
975 return ForWorker(lowerBound, toExclusive, parallelOptions, null, null, (int i, ParallelLoopState state, TLocal local) => bodyWithEverything(array[i], state, i, local), localInit, localFinally);
976 }

References System.array, and System.state.