Skip to content

Commit 05d8a51

Browse files
committed
Mop-up: remove unused parameter from netfx, sync formatting
1 parent 8a5aa7d commit 05d8a51

File tree

2 files changed

+11
-17
lines changed
  • src/Microsoft.Data.SqlClient

2 files changed

+11
-17
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8060,7 +8060,6 @@ internal TdsOperationStatus TryGetTokenLength(byte token, TdsParserStateObject s
80608060
tokenLength = -1;
80618061
return TdsOperationStatus.Done;
80628062
case TdsEnums.SQLSESSIONSTATE:
8063-
return stateObj.TryReadInt32(out tokenLength);
80648063
case TdsEnums.SQLFEDAUTHINFO:
80658064
return stateObj.TryReadInt32(out tokenLength);
80668065
}
@@ -11511,7 +11510,9 @@ private Task GetTerminationTask(Task unterminatedWriteTask, object value, MetaTy
1151111510
}
1151211511
else
1151311512
{
11514-
return AsyncHelper.CreateContinuationTask<int, TdsParserStateObject>(unterminatedWriteTask, WriteInt, 0, stateObj);
11513+
return AsyncHelper.CreateContinuationTask<int, TdsParserStateObject>(unterminatedWriteTask,
11514+
WriteInt, 0, stateObj
11515+
);
1151511516
}
1151611517
}
1151711518
else

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

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ internal sealed partial class TdsParser
138138
// textptr sequence
139139
private static readonly byte[] s_longDataHeader = { 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
140140

141-
// Various other statics
142-
private const int ATTENTION_TIMEOUT = 5000; // internal attention timeout, in ticks
143-
144141
// XML metadata substitute sequence
145142
private static readonly byte[] s_xmlMetadataSubstituteSequence = { 0xe7, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 };
146143

@@ -588,7 +585,6 @@ internal void Connect(ServerInfo serverInfo,
588585
_physicalStateObj.SniContext = SniContext.Snix_PreLogin;
589586
SqlClientEventSource.Log.TryTraceEvent("<sc.TdsParser.Connect|SEC> Consuming prelogin handshake");
590587
PreLoginHandshakeStatus status = ConsumePreLoginHandshake(
591-
authType,
592588
encrypt,
593589
trustServerCert,
594590
integratedSecurity,
@@ -636,7 +632,6 @@ internal void Connect(ServerInfo serverInfo,
636632

637633
SendPreLoginHandshake(instanceName, encrypt, integratedSecurity, serverCertificateFilename);
638634
status = ConsumePreLoginHandshake(
639-
authType,
640635
encrypt,
641636
trustServerCert,
642637
integratedSecurity,
@@ -1040,7 +1035,6 @@ private void EnableSsl(uint info, SqlConnectionEncryptOption encrypt, bool integ
10401035
}
10411036

10421037
private PreLoginHandshakeStatus ConsumePreLoginHandshake(
1043-
SqlAuthenticationMethod authType,
10441038
SqlConnectionEncryptOption encrypt,
10451039
bool trustServerCert,
10461040
bool integratedSecurity,
@@ -5174,7 +5168,7 @@ private TdsOperationStatus TryProcessTypeInfo(TdsParserStateObject stateObj, Sql
51745168

51755169
if (TdsEnums.SQLUDT == tdsType)
51765170
{
5177-
result = TryProcessUDTMetaData((SqlMetaDataPriv)col, stateObj);
5171+
result = TryProcessUDTMetaData(col, stateObj);
51785172
if (result != TdsOperationStatus.Done)
51795173
{
51805174
return result;
@@ -6591,8 +6585,8 @@ internal TdsOperationStatus TryReadSqlValue(SqlBuffer value,
65916585
}
65926586

65936587
if (md.isEncrypted
6594-
&& ((columnEncryptionOverride == SqlCommandColumnEncryptionSetting.Enabled
6595-
|| columnEncryptionOverride == SqlCommandColumnEncryptionSetting.ResultSetOnly)
6588+
&& (columnEncryptionOverride == SqlCommandColumnEncryptionSetting.Enabled
6589+
|| columnEncryptionOverride == SqlCommandColumnEncryptionSetting.ResultSetOnly
65966590
|| (columnEncryptionOverride == SqlCommandColumnEncryptionSetting.UseConnectionSetting
65976591
&& _connHandler != null && _connHandler.ConnectionOptions != null
65986592
&& _connHandler.ConnectionOptions.ColumnEncryptionSetting == SqlConnectionColumnEncryptionSetting.Enabled)))
@@ -8112,12 +8106,12 @@ internal Task WriteString(string s, int length, int offset, TdsParserStateObject
81128106
}
81138107

81148108

8115-
private unsafe static void CopyCharsToBytes(char[] source, int sourceOffset, byte[] dest, int destOffset, int charLength)
8109+
private static void CopyCharsToBytes(char[] source, int sourceOffset, byte[] dest, int destOffset, int charLength)
81168110
{
81178111
Buffer.BlockCopy(source, sourceOffset, dest, destOffset, charLength * ADP.CharSize);
81188112
}
81198113

8120-
private unsafe static void CopyStringToBytes(string source, int sourceOffset, byte[] dest, int destOffset, int charLength)
8114+
private static void CopyStringToBytes(string source, int sourceOffset, byte[] dest, int destOffset, int charLength)
81218115
{
81228116
Encoding.Unicode.GetBytes(source, sourceOffset, charLength, dest, destOffset);
81238117
}
@@ -9920,11 +9914,10 @@ internal Task TdsExecuteRPC(SqlCommand cmd, IList<_SqlRPC> rpcArray, int timeout
99209914
}
99219915
else if (mt.SqlDbType == SqlDbType.Udt)
99229916
{
9917+
int maxSupportedSize = Is2008OrNewer ? int.MaxValue : short.MaxValue;
99239918
byte[] udtVal = null;
99249919
Format format = Format.Native;
99259920

9926-
int maxSupportedSize = Is2008OrNewer ? int.MaxValue : short.MaxValue;
9927-
99289921
if (!isNull)
99299922
{
99309923
// When writing UDT parameter values to the TDS stream, allow sending byte[] or SqlBytes
@@ -10980,8 +10973,8 @@ internal void WriteBulkCopyMetaData(_SqlMetaDataSet metadataCollection, int coun
1098010973
// Write the flags
1098110974
ushort flags;
1098210975
flags = (ushort)(md.Updatability << 2);
10983-
flags |= (ushort)(md.IsNullable ? (ushort)TdsEnums.Nullable : (ushort)0);
10984-
flags |= (ushort)(md.IsIdentity ? (ushort)TdsEnums.Identity : (ushort)0);
10976+
flags |= md.IsNullable ? TdsEnums.Nullable : (ushort)0;
10977+
flags |= md.IsIdentity ? TdsEnums.Identity : (ushort)0;
1098510978

1098610979
// Write the next byte of flags
1098710980
if (IsColumnEncryptionSupported)

0 commit comments

Comments
 (0)