File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/Immediate.Cache.Shared Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -130,16 +130,12 @@ Owned<IHandler<TRequest, TResponse>> handler
130130 public async ValueTask < TResponse > GetValue ( CancellationToken cancellationToken ) =>
131131 await GetHandlerTask ( ) . WaitAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
132132
133- [ SuppressMessage ( "Maintainability" , "CA1508:Avoid dead conditional code" , Justification = "Double-checked lock pattern" ) ]
134133 private Task < TResponse > GetHandlerTask ( )
135134 {
136- if ( _responseSource is { Task . Status : not ( TaskStatus . Faulted or TaskStatus . Canceled ) } )
137- return _responseSource . Task ;
138-
139135 lock ( _lock )
140136 {
141- if ( _responseSource is { Task . Status : not ( TaskStatus . Faulted or TaskStatus . Canceled ) } )
142- return _responseSource . Task ;
137+ if ( _responseSource is { Task : { Status : not ( TaskStatus . Faulted or TaskStatus . Canceled ) } task } )
138+ return task ;
143139
144140 // escape current sync context
145141 _ = Task . Factory . StartNew (
You can’t perform that action at this time.
0 commit comments