From: Andrii Siriak Date: Fri, 21 Jun 2019 22:25:09 +0000 (+0300) Subject: Switch from IndexOf(string) to Contains(string) for better readability and performanc... X-Git-Tag: accepted/tizen/unified/20190813.215958~40^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27229c8c10fabe9c689805e68ff225a96664b5cf;p=platform%2Fupstream%2Fcoreclr.git Switch from IndexOf(string) to Contains(string) for better readability and performance (#38757) * Fix performance IndexOf(string) -> Contains(string) * Make comparison ordinal Signed-off-by: dotnet-bot --- diff --git a/src/System.Private.CoreLib/shared/Internal/Win32/RegistryKey.cs b/src/System.Private.CoreLib/shared/Internal/Win32/RegistryKey.cs index cec8e2f..f66ebf0 100644 --- a/src/System.Private.CoreLib/shared/Internal/Win32/RegistryKey.cs +++ b/src/System.Private.CoreLib/shared/Internal/Win32/RegistryKey.cs @@ -84,7 +84,7 @@ namespace Internal.Win32 public RegistryKey? OpenSubKey(string name, bool writable) { // Make sure that the name does not contain double slahes - Debug.Assert(name.IndexOf("\\\\") == -1); + Debug.Assert(!name.Contains(@"\\")); int ret = Interop.Advapi32.RegOpenKeyEx(_hkey, name,