Skip to content

Commit

Permalink
Align ADP.IsEmpty -> string.IsNullOrEmpty (#2961)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelZ authored Nov 5, 2024
1 parent 13e0f9c commit 7214342
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ internal SqlError ProcessSNIError(TdsParserStateObject stateObj)

string providerRid = String.Format("SNI_PN{0}", (int)sniError.provider);
string providerName = StringsHelper.GetString(providerRid);
Debug.Assert(!ADP.IsEmpty(providerName), $"invalid providerResourceId '{providerRid}'");
Debug.Assert(!string.IsNullOrEmpty(providerName), $"invalid providerResourceId '{providerRid}'");
uint win32ErrorCode = sniError.nativeError;

if (sniError.sniError == 0)
Expand Down Expand Up @@ -4320,7 +4320,7 @@ private TdsOperationStatus TryProcessLoginAck(TdsParserStateObject stateObj, out

// Fail if SSE UserInstance and we have not received this info.
if (_connHandler.ConnectionOptions.UserInstance &&
ADP.IsEmpty(_connHandler.InstanceName))
string.IsNullOrEmpty(_connHandler.InstanceName))
{
stateObj.AddError(new SqlError(0, 0, TdsEnums.FATAL_ERROR_CLASS, Server, SQLMessage.UserInstanceFailure(), "", 0));
ThrowExceptionAndWarning(stateObj);
Expand Down Expand Up @@ -6014,7 +6014,7 @@ private void WriteUDTMetaData(object value, string database, string schema, stri
TdsParserStateObject stateObj)
{
// database
if (ADP.IsEmpty(database))
if (string.IsNullOrEmpty(database))
{
stateObj.WriteByte(0);
}
Expand All @@ -6025,7 +6025,7 @@ private void WriteUDTMetaData(object value, string database, string schema, stri
}

// schema
if (ADP.IsEmpty(schema))
if (string.IsNullOrEmpty(schema))
{
stateObj.WriteByte(0);
}
Expand All @@ -6036,7 +6036,7 @@ private void WriteUDTMetaData(object value, string database, string schema, stri
}

// type
if (ADP.IsEmpty(type))
if (string.IsNullOrEmpty(type))
{
stateObj.WriteByte(0);
}
Expand Down Expand Up @@ -9303,7 +9303,7 @@ private void WriteLoginData(SqlLogin rec,
}

// 4th one
if (!ADP.IsEmpty(rec.newPassword) || (rec.newSecurePassword != null && rec.newSecurePassword.Length != 0))
if (!string.IsNullOrEmpty(rec.newPassword) || (rec.newSecurePassword != null && rec.newSecurePassword.Length != 0))
{
log7Flags |= 1 << 24;
}
Expand Down Expand Up @@ -10112,7 +10112,7 @@ internal Task TdsExecuteRPC(SqlCommand cmd, IList<_SqlRPC> rpcArray, int timeout
}
else
{
Debug.Assert(!ADP.IsEmpty(rpcext.rpcName), "must have an RPC name");
Debug.Assert(!string.IsNullOrEmpty(rpcext.rpcName), "must have an RPC name");
tempLen = rpcext.rpcName.Length;
WriteShort(tempLen, stateObj);
WriteString(rpcext.rpcName, tempLen, 0, stateObj);
Expand Down Expand Up @@ -11155,8 +11155,8 @@ private void WriteSmiTypeInfo(SmiExtendedMetaData metaData, TdsParserStateObject
case SqlDbType.Xml:
stateObj.WriteByte(TdsEnums.SQLXMLTYPE);
// Is there a schema
if (ADP.IsEmpty(metaData.TypeSpecificNamePart1) && ADP.IsEmpty(metaData.TypeSpecificNamePart2) &&
ADP.IsEmpty(metaData.TypeSpecificNamePart3))
if (string.IsNullOrEmpty(metaData.TypeSpecificNamePart1) && string.IsNullOrEmpty(metaData.TypeSpecificNamePart2) &&
string.IsNullOrEmpty(metaData.TypeSpecificNamePart3))
{
stateObj.WriteByte(0); // schema not present
}
Expand Down

0 comments on commit 7214342

Please sign in to comment.