@@ -184,17 +184,9 @@ public BenchmarkAction(object instance, MethodInfo method, int unrollFactor)
184
184
InvokeMultiple = InvokeMultipleHardcoded ;
185
185
}
186
186
187
- private static T OverheadStatic ( )
188
- {
189
- Unsafe . SkipInit ( out T value ) ;
190
- return value ;
191
- }
187
+ private static T OverheadStatic ( ) => default ;
192
188
193
- private T OverheadInstance ( )
194
- {
195
- Unsafe . SkipInit ( out T value ) ;
196
- return value ;
197
- }
189
+ private T OverheadInstance ( ) => default ;
198
190
199
191
private void InvokeSingleHardcoded ( ) => consumer . Consume ( callback ( ) ) ;
200
192
@@ -274,11 +266,7 @@ public BenchmarkActionTask(object instance, MethodInfo method, int unrollFactor)
274
266
InvokeMultiple = InvokeMultipleHardcoded ;
275
267
}
276
268
277
- private T Overhead ( )
278
- {
279
- Unsafe . SkipInit ( out T value ) ;
280
- return value ;
281
- }
269
+ private T Overhead ( ) => default ;
282
270
283
271
// must be kept in sync with GenericTaskDeclarationsProvider.TargetMethodDelegate
284
272
private T ExecuteBlocking ( ) => startTaskCallback ( ) . GetAwaiter ( ) . GetResult ( ) ;
@@ -362,11 +350,7 @@ public BenchmarkActionValueTask(object instance, MethodInfo method, int unrollFa
362
350
InvokeMultiple = InvokeMultipleHardcoded ;
363
351
}
364
352
365
- private T Overhead ( )
366
- {
367
- Unsafe . SkipInit ( out T value ) ;
368
- return value ;
369
- }
353
+ private T Overhead ( ) => default ;
370
354
371
355
// must be kept in sync with GenericTaskDeclarationsProvider.TargetMethodDelegate
372
356
private T ExecuteBlocking ( ) => startTaskCallback ( ) . GetAwaiter ( ) . GetResult ( ) ;
0 commit comments