Skip to content

Commit b448eb0

Browse files
committed
reduce unnecessary assignments
1 parent 18cf7bd commit b448eb0

File tree

2 files changed

+2
-5
lines changed
  • src/Microsoft.Data.SqlClient

2 files changed

+2
-5
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,6 @@ internal void Connect(ServerInfo serverInfo,
384384

385385
uint sniStatus = TdsParserStateObjectFactory.Singleton.SNIStatus;
386386

387-
string[] serverSpn = null;
388-
389387
if (sniStatus != TdsEnums.SNI_SUCCESS)
390388
{
391389
_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj));
@@ -395,7 +393,6 @@ internal void Connect(ServerInfo serverInfo,
395393
}
396394
else
397395
{
398-
serverSpn = null;
399396
SqlClientEventSource.Log.TryTraceEvent("TdsParser.Connect | SEC | Connection Object Id {0}, Authentication Mode: {1}", _connHandler.ObjectID,
400397
authType == SqlAuthenticationMethod.NotSpecified ? SqlAuthenticationMethod.SqlPassword.ToString() : authType.ToString());
401398
}
@@ -407,7 +404,6 @@ internal void Connect(ServerInfo serverInfo,
407404
SqlClientEventSource.Log.TryTraceEvent("<sc.TdsParser.Connect|SEC> Encryption will be disabled as target server is a SQL Local DB instance.");
408405
}
409406

410-
serverSpn = null;
411407
_authenticationProvider = null;
412408

413409
// AD Integrated behaves like Windows integrated when connecting to a non-fedAuth server
@@ -441,6 +437,8 @@ internal void Connect(ServerInfo serverInfo,
441437

442438
_connHandler.pendingSQLDNSObject = null;
443439

440+
string[] serverSpn = null;
441+
444442
// AD Integrated behaves like Windows integrated when connecting to a non-fedAuth server
445443
_physicalStateObj.CreatePhysicalSNIHandle(
446444
serverInfo.ExtendedServerName,

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ internal void Connect(ServerInfo serverInfo,
429429
else
430430
{
431431
_authenticationProvider = null;
432-
serverSpn = null;
433432

434433
switch (authType)
435434
{

0 commit comments

Comments
 (0)