@@ -26,7 +26,7 @@ public static partial class ParallelRowIterator
26
26
public static void IterateRows < T > ( Configuration configuration , Rectangle rectangle , in T operation )
27
27
where T : struct , IRowOperation
28
28
{
29
- var parallelSettings = ParallelExecutionSettings . FromConfiguration ( configuration ) ;
29
+ ParallelExecutionSettings parallelSettings = ParallelExecutionSettings . FromConfiguration ( configuration ) ;
30
30
IterateRows ( rectangle , in parallelSettings , in operation ) ;
31
31
}
32
32
@@ -65,8 +65,8 @@ public static void IterateRows<T>(
65
65
}
66
66
67
67
int verticalStep = DivideCeil ( rectangle . Height , numOfSteps ) ;
68
- var parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = numOfSteps } ;
69
- var wrappingOperation = new RowOperationWrapper < T > ( top , bottom , verticalStep , in operation ) ;
68
+ ParallelOptions ? parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = numOfSteps } ;
69
+ RowOperationWrapper < T > wrappingOperation = new RowOperationWrapper < T > ( top , bottom , verticalStep , in operation ) ;
70
70
71
71
Parallel . For (
72
72
0 ,
@@ -88,7 +88,7 @@ public static void IterateRows<T, TBuffer>(Configuration configuration, Rectangl
88
88
where T : struct , IRowOperation < TBuffer >
89
89
where TBuffer : unmanaged
90
90
{
91
- var parallelSettings = ParallelExecutionSettings . FromConfiguration ( configuration ) ;
91
+ ParallelExecutionSettings parallelSettings = ParallelExecutionSettings . FromConfiguration ( configuration ) ;
92
92
IterateRows < T , TBuffer > ( rectangle , in parallelSettings , in operation ) ;
93
93
}
94
94
@@ -135,8 +135,8 @@ public static void IterateRows<T, TBuffer>(
135
135
}
136
136
137
137
int verticalStep = DivideCeil ( height , numOfSteps ) ;
138
- var parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = numOfSteps } ;
139
- var wrappingOperation = new RowOperationWrapper < T , TBuffer > ( top , bottom , verticalStep , bufferLength , allocator , in operation ) ;
138
+ ParallelOptions ? parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = numOfSteps } ;
139
+ RowOperationWrapper < T , TBuffer > wrappingOperation = new RowOperationWrapper < T , TBuffer > ( top , bottom , verticalStep , bufferLength , allocator , in operation ) ;
140
140
141
141
Parallel . For (
142
142
0 ,
@@ -156,7 +156,7 @@ public static void IterateRows<T, TBuffer>(
156
156
public static void IterateRowIntervals < T > ( Configuration configuration , Rectangle rectangle , in T operation )
157
157
where T : struct , IRowIntervalOperation
158
158
{
159
- var parallelSettings = ParallelExecutionSettings . FromConfiguration ( configuration ) ;
159
+ ParallelExecutionSettings parallelSettings = ParallelExecutionSettings . FromConfiguration ( configuration ) ;
160
160
IterateRowIntervals ( rectangle , in parallelSettings , in operation ) ;
161
161
}
162
162
@@ -186,14 +186,14 @@ public static void IterateRowIntervals<T>(
186
186
// Avoid TPL overhead in this trivial case:
187
187
if ( numOfSteps == 1 )
188
188
{
189
- var rows = new RowInterval ( top , bottom ) ;
189
+ RowInterval rows = new RowInterval ( top , bottom ) ;
190
190
Unsafe . AsRef ( in operation ) . Invoke ( in rows ) ;
191
191
return ;
192
192
}
193
193
194
194
int verticalStep = DivideCeil ( rectangle . Height , numOfSteps ) ;
195
- var parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = numOfSteps } ;
196
- var wrappingOperation = new RowIntervalOperationWrapper < T > ( top , bottom , verticalStep , in operation ) ;
195
+ ParallelOptions ? parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = numOfSteps } ;
196
+ RowIntervalOperationWrapper < T > wrappingOperation = new RowIntervalOperationWrapper < T > ( top , bottom , verticalStep , in operation ) ;
197
197
198
198
Parallel . For (
199
199
0 ,
@@ -215,7 +215,7 @@ public static void IterateRowIntervals<T, TBuffer>(Configuration configuration,
215
215
where T : struct , IRowIntervalOperation < TBuffer >
216
216
where TBuffer : unmanaged
217
217
{
218
- var parallelSettings = ParallelExecutionSettings . FromConfiguration ( configuration ) ;
218
+ ParallelExecutionSettings parallelSettings = ParallelExecutionSettings . FromConfiguration ( configuration ) ;
219
219
IterateRowIntervals < T , TBuffer > ( rectangle , in parallelSettings , in operation ) ;
220
220
}
221
221
@@ -250,7 +250,7 @@ public static void IterateRowIntervals<T, TBuffer>(
250
250
// Avoid TPL overhead in this trivial case:
251
251
if ( numOfSteps == 1 )
252
252
{
253
- var rows = new RowInterval ( top , bottom ) ;
253
+ RowInterval rows = new RowInterval ( top , bottom ) ;
254
254
using IMemoryOwner < TBuffer > buffer = allocator . Allocate < TBuffer > ( bufferLength ) ;
255
255
256
256
Unsafe . AsRef ( in operation ) . Invoke ( in rows , buffer . Memory . Span ) ;
@@ -259,8 +259,8 @@ public static void IterateRowIntervals<T, TBuffer>(
259
259
}
260
260
261
261
int verticalStep = DivideCeil ( height , numOfSteps ) ;
262
- var parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = numOfSteps } ;
263
- var wrappingOperation = new RowIntervalOperationWrapper < T , TBuffer > ( top , bottom , verticalStep , bufferLength , allocator , in operation ) ;
262
+ ParallelOptions ? parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = numOfSteps } ;
263
+ RowIntervalOperationWrapper < T , TBuffer > wrappingOperation = new RowIntervalOperationWrapper < T , TBuffer > ( top , bottom , verticalStep , bufferLength , allocator , in operation ) ;
264
264
265
265
Parallel . For (
266
266
0 ,
0 commit comments