Skip to content

Commit c636056

Browse files
Wraith2cheenamalhotra
authored andcommitted
Perf: Remove double fetch of domain name (#366)
1 parent 18bce3c commit c636056

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPoolIdentity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ override public int GetHashCode()
4545

4646
internal static DbConnectionPoolIdentity GetCurrentManaged()
4747
{
48-
string sidString = (!string.IsNullOrWhiteSpace(System.Environment.UserDomainName) ? System.Environment.UserDomainName + "\\" : "")
49-
+ System.Environment.UserName;
48+
string domainString = System.Environment.UserDomainName;
49+
string sidString = (!string.IsNullOrWhiteSpace(domainString) ? domainString + "\\" : "") + System.Environment.UserName;
5050
bool isNetwork = false;
5151
bool isRestricted = false;
5252
return new DbConnectionPoolIdentity(sidString, isRestricted, isNetwork);

0 commit comments

Comments
 (0)