This repository was archived by the owner on Sep 5, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed
Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 1111 <ItemGroup >
1212 <PackageReference Include =" BenchmarkDotNet" Version =" 0.11.1" />
1313 <PackageReference Include =" Moq" Version =" 4.9.0" />
14- <PackageReference Include =" System.Collections.Immutable" Version =" 1.5.0" />
1514 </ItemGroup >
1615
1716 <ItemGroup >
Original file line number Diff line number Diff line change 2121 <DebugType >pdbonly</DebugType >
2222 <DebugSymbols >true</DebugSymbols >
2323 </PropertyGroup >
24-
25- <ItemGroup >
26- <PackageReference Include =" System.Collections.Immutable" Version =" 1.5.0" />
27- </ItemGroup >
2824</Project >
Original file line number Diff line number Diff line change @@ -150,13 +150,12 @@ public Task<TValue> LoadAsync(TKey key)
150150
151151 if ( _options . Batching )
152152 {
153- if ( ! _buffer . TryAdd ( resolvedKey , promise ) )
154- {
155- if ( _buffer . TryGetValue ( resolvedKey ,
153+ if ( ! _buffer . TryAdd ( resolvedKey , promise ) &&
154+ _buffer . TryGetValue ( resolvedKey ,
156155 out TaskCompletionSource < TValue > value ) )
157- {
158- promise = value ;
159- }
156+ {
157+ promise . TrySetCanceled ( ) ;
158+ promise = value ;
160159 }
161160 }
162161 else
You can’t perform that action at this time.
0 commit comments