Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This one aligns var vs Type between netfx and netcore #2959

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,7 @@ internal void ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand
// report exception to pending async operation
// before OnConnectionClosed overrides the exception
// due to connection close notification through references
var taskSource = stateObj._networkPacketTaskSource;
TaskCompletionSource<object> taskSource = stateObj._networkPacketTaskSource;
if (taskSource != null)
{
taskSource.TrySetException(ADP.ExceptionWithStackTrace(exception));
Expand All @@ -1746,7 +1746,7 @@ internal void ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand
if (asyncClose)
{
// Wait until we have the parser lock, then try to close
var connHandler = _connHandler;
SqlInternalConnectionTds connHandler = _connHandler;
Action<Action> wrapCloseAction = closeAction =>
{
Task.Factory.StartNew(() =>
Expand Down Expand Up @@ -3081,7 +3081,7 @@ private TdsOperationStatus TryProcessEnvChange(int tokenLength, TdsParserStateOb

while (tokenLength > processedLength)
{
var env = new SqlEnvChange();
SqlEnvChange env = new SqlEnvChange();
TdsOperationStatus result = stateObj.TryReadByte(out env._type);
if (result != TdsOperationStatus.Done)
{
Expand Down Expand Up @@ -3941,7 +3941,7 @@ private TdsOperationStatus TryProcessDataClassification(TdsParserStateObject sta
{
return result;
}
var labels = new List<Label>(numLabels);
List<Label> labels = new List<Label>(numLabels);
for (ushort i = 0; i < numLabels; i++)
{
result = TryReadSensitivityLabel(stateObj, out string label, out string id);
Expand All @@ -3958,7 +3958,7 @@ private TdsOperationStatus TryProcessDataClassification(TdsParserStateObject sta
{
return result;
}
var informationTypes = new List<InformationType>(numInformationTypes);
List<InformationType> informationTypes = new List<InformationType>(numInformationTypes);
for (ushort i = 0; i < numInformationTypes; i++)
{
result = TryReadSensitivityInformationType(stateObj, out string informationType, out string id);
Expand Down Expand Up @@ -3990,7 +3990,7 @@ private TdsOperationStatus TryProcessDataClassification(TdsParserStateObject sta
{
return result;
}
var columnSensitivities = new List<ColumnSensitivity>(numResultColumns);
List<ColumnSensitivity> columnSensitivities = new List<ColumnSensitivity>(numResultColumns);
for (ushort columnNum = 0; columnNum < numResultColumns; columnNum++)
{
// get sensitivity properties for all the different sources which were used in generating the column output
Expand All @@ -3999,7 +3999,7 @@ private TdsOperationStatus TryProcessDataClassification(TdsParserStateObject sta
{
return result;
}
var sensitivityProperties = new List<SensitivityProperty>(numSources);
List<SensitivityProperty> sensitivityProperties = new List<SensitivityProperty>(numSources);
for (ushort sourceNum = 0; sourceNum < numSources; sourceNum++)
{
// get the label index and then lookup label to use for source
Expand Down Expand Up @@ -8667,12 +8667,12 @@ private Task WriteEncodingChar(string s, int numChars, int offset, Encoding enco
else
{
#if NETFRAMEWORK
var charData = s.ToCharArray(offset, numChars);
var byteData = encoding.GetBytes(charData, 0, numChars);
char[] charData = s.ToCharArray(offset, numChars);
byte[] byteData = encoding.GetBytes(charData, 0, numChars);
Debug.Assert(byteData != null, "no data from encoding");
return stateObj.WriteByteArray(byteData, byteData.Length, 0, canAccumulate);
#else
var byteData = encoding.GetBytes(s, offset, numChars);
byte[] byteData = encoding.GetBytes(s, offset, numChars);
Debug.Assert(byteData != null, "no data from encoding");
return stateObj.WriteByteArray(byteData, byteData.Length, 0, canAccumulate);
#endif
Expand Down
Loading