@@ -184,17 +184,9 @@ public BenchmarkAction(object instance, MethodInfo method, int unrollFactor)
184184 InvokeMultiple = InvokeMultipleHardcoded ;
185185 }
186186
187- private static T OverheadStatic ( )
188- {
189- Unsafe . SkipInit ( out T value ) ;
190- return value ;
191- }
187+ private static T OverheadStatic ( ) => default ;
192188
193- private T OverheadInstance ( )
194- {
195- Unsafe . SkipInit ( out T value ) ;
196- return value ;
197- }
189+ private T OverheadInstance ( ) => default ;
198190
199191 private void InvokeSingleHardcoded ( ) => consumer . Consume ( callback ( ) ) ;
200192
@@ -274,11 +266,7 @@ public BenchmarkActionTask(object instance, MethodInfo method, int unrollFactor)
274266 InvokeMultiple = InvokeMultipleHardcoded ;
275267 }
276268
277- private T Overhead ( )
278- {
279- Unsafe . SkipInit ( out T value ) ;
280- return value ;
281- }
269+ private T Overhead ( ) => default ;
282270
283271 // must be kept in sync with GenericTaskDeclarationsProvider.TargetMethodDelegate
284272 private T ExecuteBlocking ( ) => startTaskCallback ( ) . GetAwaiter ( ) . GetResult ( ) ;
@@ -362,11 +350,7 @@ public BenchmarkActionValueTask(object instance, MethodInfo method, int unrollFa
362350 InvokeMultiple = InvokeMultipleHardcoded ;
363351 }
364352
365- private T Overhead ( )
366- {
367- Unsafe . SkipInit ( out T value ) ;
368- return value ;
369- }
353+ private T Overhead ( ) => default ;
370354
371355 // must be kept in sync with GenericTaskDeclarationsProvider.TargetMethodDelegate
372356 private T ExecuteBlocking ( ) => startTaskCallback ( ) . GetAwaiter ( ) . GetResult ( ) ;
0 commit comments