Skip to content

Commit 96acacd

Browse files
committed
Slight optimization
1 parent fa2dbf1 commit 96acacd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ await GetNoncePayloadAsync(),
260260

261261
protected override async Task<IEnumerable<KeyValuePair<string, ExchangeTicker>>> OnGetTickersAsync()
262262
{
263-
List<KeyValuePair<string, ExchangeTicker>> tickers = new List<KeyValuePair<string, ExchangeTicker>>();
263+
Dictionary<string, ExchangeTicker> tickers = new Dictionary<string, ExchangeTicker>(StringComparer.OrdinalIgnoreCase);
264264
System.Threading.ManualResetEvent evt = new System.Threading.ManualResetEvent(false);
265265
List<string> symbols = (await GetMarketSymbolsAsync()).ToList();
266266

@@ -273,9 +273,9 @@ protected override async Task<IEnumerable<KeyValuePair<string, ExchangeTicker>>>
273273
{
274274
foreach (var kv in t)
275275
{
276-
if (!tickers.Exists(m => m.Key == kv.Key))
276+
if (!tickers.ContainsKey(kv.Key))
277277
{
278-
tickers.Add(kv);
278+
tickers[kv.Key] = kv.Value;
279279
symbols.Remove(kv.Key);
280280
}
281281
}

0 commit comments

Comments
 (0)