Remove HasWildCardCharacters method (#57028)
authorIlya <darpa@yandex.ru>
Sun, 8 Aug 2021 20:32:20 +0000 (01:32 +0500)
committerGitHub <noreply@github.com>
Sun, 8 Aug 2021 20:32:20 +0000 (14:32 -0600)
It is not used any more.

src/libraries/System.Private.CoreLib/src/System/IO/PathInternal.Windows.cs

index dd9442b..b1767b3 100644 (file)
@@ -172,29 +172,6 @@ namespace System.IO
         }
 
         /// <summary>
-        /// Check for known wildcard characters. '*' and '?' are the most common ones.
-        /// </summary>
-        internal static bool HasWildCardCharacters(ReadOnlySpan<char> path)
-        {
-            // Question mark is part of dos device syntax so we have to skip if we are
-            int startIndex = IsDevice(path) ? ExtendedPathPrefix.Length : 0;
-
-            // [MS - FSA] 2.1.4.4 Algorithm for Determining if a FileName Is in an Expression
-            // https://msdn.microsoft.com/en-us/library/ff469270.aspx
-            for (int i = startIndex; i < path.Length; i++)
-            {
-                char c = path[i];
-                if (c <= '?') // fast path for common case - '?' is highest wildcard character
-                {
-                    if (c == '\"' || c == '<' || c == '>' || c == '*' || c == '?')
-                        return true;
-                }
-            }
-
-            return false;
-        }
-
-        /// <summary>
         /// Gets the length of the root of the path (drive, share, etc.).
         /// </summary>
         internal static int GetRootLength(ReadOnlySpan<char> path)