From: Alaa Masoud Date: Thu, 20 Feb 2020 16:52:19 +0000 (+0300) Subject: Avoid Split(new char[]) inside loops (#32601) X-Git-Tag: submit/tizen/20210909.063632~9595 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f38f64ceb2ece3e57742e798409642565ddfcb0;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Avoid Split(new char[]) inside loops (#32601) --- diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapDirectoryIdentifier.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapDirectoryIdentifier.cs index 02e2fde..2d512ca7 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapDirectoryIdentifier.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapDirectoryIdentifier.cs @@ -35,7 +35,7 @@ namespace System.DirectoryServices.Protocols if (servers[i] != null) { string trimmedName = servers[i].Trim(); - string[] result = trimmedName.Split(new char[] { ' ' }); + string[] result = trimmedName.Split(' '); if (result.Length > 1) { throw new ArgumentException(SR.WhiteSpaceServerName); diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs index 7f093c6..78573e9 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs @@ -1003,7 +1003,7 @@ namespace System.DirectoryServices _propertyCollection.valueTable.Remove(name); // also need to consider the range retrieval case - string[] results = name.Split(new char[] { ';' }); + string[] results = name.Split(';'); if (results.Length != 1) { string rangeName = "";