Skip to content

Commit

Permalink
remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoRossignoli committed Feb 13, 2018
1 parent 8c9a215 commit bee8ebc
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/System.Net.NameResolution/src/System/Net/DNS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ private static IPHostEntry InternalGetHostByName(string hostName)
if (NetEventSource.IsEnabled) NetEventSource.Enter(null, hostName);
IPHostEntry ipHostEntry = null;

if (hostName.Length > MaxHostName // If 255 chars, the last one must be a dot.
|| hostName.Length == MaxHostName && hostName[MaxHostName - 1] != '.')
{
throw new ArgumentOutOfRangeException(nameof(hostName), SR.Format(SR.net_toolong,
nameof(hostName), MaxHostName.ToString(NumberFormatInfo.CurrentInfo)));
}
ValidateHostName(hostName);

int nativeErrorCode;
SocketError errorCode = NameResolutionPal.TryGetAddrInfo(hostName, out ipHostEntry, out nativeErrorCode);
Expand Down

0 comments on commit bee8ebc

Please sign in to comment.