From c09fe331678b8ad74fe9103f146e8eb18baa801a Mon Sep 17 00:00:00 2001 From: solarin Date: Fri, 3 Apr 2020 22:38:20 +0400 Subject: [PATCH] replace .count()==0 with !.any() --- TLSharp.Core/TelegramClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index f8adc88..8da736f 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -126,7 +126,7 @@ namespace TLSharp.Core TLDcOption dc; if (dcIpVersion != DataCenterIPVersion.Default) { - if (dcs.Count() == 0) + if (!dcs.Any()) throw new Exception($"Telegram server didn't provide us with any IPAddress that matches your preferences. If you chose OnlyIPvX, try switch to PreferIPvX instead."); dcs = dcs.OrderBy(d => d.Ipv6); dc = dcIpVersion == DataCenterIPVersion.PreferIPv4 ? dcs.First() : dcs.Last(); // ipv4 addresses are at the beginning of the list because it was ordered