mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
made the if more readable
This commit is contained in:
parent
c09fe33167
commit
8de1d7f5ce
|
|
@ -113,16 +113,14 @@ namespace TLSharp.Core
|
||||||
exported = await SendRequestAsync<TLExportedAuthorization>(exportAuthorization, token).ConfigureAwait(false);
|
exported = await SendRequestAsync<TLExportedAuthorization>(exportAuthorization, token).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var dcs = dcOptions.Where(d => d.Id == dcId
|
IEnumerable<TLDcOption> dcs;
|
||||||
&& (
|
if (dcIpVersion == DataCenterIPVersion.OnlyIPv6)
|
||||||
(dcIpVersion == DataCenterIPVersion.Default) // any
|
dcs = dcOptions.Where(d => d.Id == dcId && d.Ipv6); // selects only ipv6 addresses
|
||||||
|| (d.Ipv6 && dcIpVersion == DataCenterIPVersion.OnlyIPv6) // selects only ipv6 addresses
|
else if (dcIpVersion == DataCenterIPVersion.OnlyIPv4)
|
||||||
|| (!d.Ipv6 && dcIpVersion == DataCenterIPVersion.OnlyIPv4) // selects only ipv4 addresses
|
dcs = dcOptions.Where(d => d.Id == dcId && !d.Ipv6); // selects only ipv4 addresses
|
||||||
|| dcIpVersion == DataCenterIPVersion.PreferIPv4 // we can take both types of address
|
else
|
||||||
|| dcIpVersion == DataCenterIPVersion.PreferIPv6 // we can take both types of address
|
dcs = dcOptions.Where(d => d.Id == dcId); // any
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
TLDcOption dc;
|
TLDcOption dc;
|
||||||
if (dcIpVersion != DataCenterIPVersion.Default)
|
if (dcIpVersion != DataCenterIPVersion.Default)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue