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

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

static ParallelLoopResult System.Threading.Tasks.Parallel.ForEachWorker< TSource, TLocal > ( IList< TSource > list,
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 978 of file Parallel.cs.

979 {
980 if (body != null)
981 {
982 return ForWorker<object>(0, list.Count, parallelOptions, delegate(int i)
983 {
984 body(list[i]);
985 }, null, null, null, null);
986 }
987 if (bodyWithState != null)
988 {
989 return ForWorker<object>(0, list.Count, parallelOptions, null, delegate(int i, ParallelLoopState state)
990 {
992 }, null, null, null);
993 }
994 if (bodyWithStateAndIndex != null)
995 {
996 return ForWorker<object>(0, list.Count, parallelOptions, null, delegate(int i, ParallelLoopState state)
997 {
999 }, null, null, null);
1000 }
1001 if (bodyWithStateAndLocal != null)
1002 {
1003 return ForWorker(0, list.Count, parallelOptions, null, null, (int i, ParallelLoopState state, TLocal local) => bodyWithStateAndLocal(list[i], state, local), localInit, localFinally);
1004 }
1005 return ForWorker(0, list.Count, parallelOptions, null, null, (int i, ParallelLoopState state, TLocal local) => bodyWithEverything(list[i], state, i, local), localInit, localFinally);
1006 }

References System.list, and System.state.