@@ -25,41 +25,33 @@ public Task GlobalSetup()
2525 }
2626
2727 [ Benchmark ]
28- public object Cache_Synchronous_Hit ( )
29- {
30- return SyncPolicyHit . Execute ( _ => GetObject ( ) , HitContext ) ;
31- }
28+ public object Cache_Synchronous_Hit ( ) =>
29+ SyncPolicyHit . Execute ( _ => GetObject ( ) , HitContext ) ;
3230
3331 [ Benchmark ]
34- public Task < object > Cache_Asynchronous_Hit ( )
35- {
36- return AsyncPolicyHit . ExecuteAsync ( ( _ , token ) => GetObjectAsync ( token ) , HitContext , CancellationToken . None ) ;
37- }
32+ public Task < object > Cache_Asynchronous_Hit ( ) =>
33+ AsyncPolicyHit . ExecuteAsync ( ( _ , token ) => GetObjectAsync ( token ) , HitContext , CancellationToken . None ) ;
3834
3935 [ Benchmark ]
40- public object Cache_Synchronous_Miss ( )
41- {
42- return SyncPolicyMiss . Execute ( _ => GetObject ( ) , MissContext ) ;
43- }
36+ public object Cache_Synchronous_Miss ( ) =>
37+ SyncPolicyMiss . Execute ( _ => GetObject ( ) , MissContext ) ;
4438
4539 [ Benchmark ]
46- public Task < object > Cache_Asynchronous_Miss ( )
47- {
48- return AsyncPolicyMiss . ExecuteAsync ( ( _ , token ) => GetObjectAsync ( token ) , MissContext , CancellationToken . None ) ;
49- }
40+ public Task < object > Cache_Asynchronous_Miss ( ) =>
41+ AsyncPolicyMiss . ExecuteAsync ( ( _ , token ) => GetObjectAsync ( token ) , MissContext , CancellationToken . None ) ;
5042
51- private static object GetObject ( ) => new object ( ) ;
43+ private static object GetObject ( ) =>
44+ new object ( ) ;
5245
53- private static Task < object > GetObjectAsync ( CancellationToken cancellationToken ) => Task . FromResult ( new object ( ) ) ;
46+ private static Task < object > GetObjectAsync ( CancellationToken cancellationToken ) =>
47+ Task . FromResult ( new object ( ) ) ;
5448
5549 private sealed class MemoryCacheProvider : ISyncCacheProvider , IAsyncCacheProvider
5650 {
5751 private readonly IMemoryCache _cache ;
5852
59- public MemoryCacheProvider ( IMemoryCache memoryCache )
60- {
53+ public MemoryCacheProvider ( IMemoryCache memoryCache ) =>
6154 _cache = memoryCache ;
62- }
6355
6456 public ( bool , object ? ) TryGet ( string key )
6557 {
@@ -91,10 +83,8 @@ public void Put(string key, object value, Ttl ttl)
9183 _cache . Set ( key , value , options ) ;
9284 }
9385
94- public Task < ( bool , object ? ) > TryGetAsync ( string key , CancellationToken cancellationToken , bool continueOnCapturedContext )
95- {
96- return Task . FromResult ( TryGet ( key ) ) ;
97- }
86+ public Task < ( bool , object ? ) > TryGetAsync ( string key , CancellationToken cancellationToken , bool continueOnCapturedContext ) =>
87+ Task . FromResult ( TryGet ( key ) ) ;
9888
9989 public Task PutAsync ( string key , object value , Ttl ttl , CancellationToken cancellationToken , bool continueOnCapturedContext )
10090 {
0 commit comments