Skip to content

Commit

Permalink
Remove a couple unnecessary ToStrings in System.DirectoryServices (#3…
Browse files Browse the repository at this point in the history
…4244)

These are calling ToString on a StringBuilder, but StringBuilder.Append has a StringBuilder-based overload in netcoreapp.  On other builds this will just fall back to the object-based overload, which will call ToString.
  • Loading branch information
stephentoub authored Mar 28, 2020
1 parent 917c1a8 commit 419e949
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ private Principal FindPrincipalByIdentRefHelper(

innerLdapFilter.Append(')');

ldapFilter.Append(innerLdapFilter.ToString());
ldapFilter.Append(innerLdapFilter);
}

// Wrap off the filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public object GetValue()
strb.Append("B:");
strb.Append(binaryPart.Length);
strb.Append(':');
strb.Append(binaryPart.ToString());
strb.Append(binaryPart);
strb.Append(':');
strb.Append(Marshal.PtrToStringUni(dnb.pszDNString));

Expand Down

0 comments on commit 419e949

Please sign in to comment.