Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortherzok <marius.ungureanu@xamarin.com>2019-07-21 11:17:19 +0300
committertherzok <marius.ungureanu@xamarin.com>2019-07-22 14:29:45 +0300
commitc065cc1b8473b3ae6dfe37d3a8ff326002a1054e (patch)
treea1c6d515c5a5a005346171bdd5373aac97f65505
parentba1df8f0ccd4814eb46f15454b13b02d10732439 (diff)
Deduplicate all the span slice callsglob-opt
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs19
1 files changed, 10 insertions, 9 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs
index 20c80a9b44..1110823bbe 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs
@@ -883,7 +883,7 @@ namespace MonoDevelop.Projects.MSBuild
delegate T WildcardExpansionFunc<T> (string filePath, string include, string recursiveDir);
- static IEnumerable<T> ExpandWildcardFilePath<T> (MSBuildProject project, FilePath basePath, FilePath baseRecursiveDir, in ReadOnlySpan<string> filePath, WildcardExpansionFunc<T> func, Regex directoryExcludeRegex)
+ static IEnumerable<T> ExpandWildcardFilePath<T> (MSBuildProject project, FilePath basePath, FilePath baseRecursiveDir, ReadOnlySpan<string> filePath, WildcardExpansionFunc<T> func, Regex directoryExcludeRegex)
{
var res = Enumerable.Empty<T> ();
@@ -891,12 +891,13 @@ namespace MonoDevelop.Projects.MSBuild
return res;
var path = filePath [0];
+ filePath = filePath.Slice (1);
if (path == "..")
- return ExpandWildcardFilePath (project, basePath.ParentDirectory, baseRecursiveDir, filePath.Slice (1), func, directoryExcludeRegex);
+ return ExpandWildcardFilePath (project, basePath.ParentDirectory, baseRecursiveDir, filePath, func, directoryExcludeRegex);
if (path == ".")
- return ExpandWildcardFilePath (project, basePath, baseRecursiveDir, filePath.Slice (1), func, directoryExcludeRegex);
+ return ExpandWildcardFilePath (project, basePath, baseRecursiveDir, filePath, func, directoryExcludeRegex);
if (directoryExcludeRegex != null && directoryExcludeRegex.IsMatch (basePath.ToString ().Replace ('/', '\\')))
return res;
@@ -906,22 +907,22 @@ namespace MonoDevelop.Projects.MSBuild
if (path == "**") {
// if this is the last component of the path, there isn't any file specifier, so there is no possible match
- if (filePath.Length == 1)
+ if (filePath.Length == 0)
return res;
// If baseRecursiveDir has already been set, don't overwrite it.
if (baseRecursiveDir.IsNullOrEmpty)
baseRecursiveDir = basePath;
- res = FastConcat (res, ExpandWildcardFilePath (project, basePath, baseRecursiveDir, filePath.Slice (1), func, directoryExcludeRegex));
+ res = FastConcat (res, ExpandWildcardFilePath (project, basePath, baseRecursiveDir, filePath, func, directoryExcludeRegex));
foreach (var dir in Directory.EnumerateDirectories (basePath, "*", SearchOption.AllDirectories))
- res = FastConcat (res, ExpandWildcardFilePath (project, dir, baseRecursiveDir, filePath.Slice (1), func, directoryExcludeRegex));
+ res = FastConcat (res, ExpandWildcardFilePath (project, dir, baseRecursiveDir, filePath, func, directoryExcludeRegex));
return res;
}
- if (filePath.Length == 1) {
+ if (filePath.Length == 0) {
// Last path component. It has to be a file specifier.
string baseDir = basePath.ToRelative (project.BaseDirectory).ToString ().Replace ('/', '\\');
if (baseDir == ".")
@@ -938,10 +939,10 @@ namespace MonoDevelop.Projects.MSBuild
if (path.IndexOfAny (wildcards) != -1) {
foreach (var dir in Directory.EnumerateDirectories (basePath, path)) {
- res = FastConcat (res, ExpandWildcardFilePath (project, dir, baseRecursiveDir, filePath.Slice (1), func, directoryExcludeRegex));
+ res = FastConcat (res, ExpandWildcardFilePath (project, dir, baseRecursiveDir, filePath, func, directoryExcludeRegex));
}
} else
- res = FastConcat (res, ExpandWildcardFilePath (project, basePath.Combine (path), baseRecursiveDir, filePath.Slice (1), func, directoryExcludeRegex));
+ res = FastConcat (res, ExpandWildcardFilePath (project, basePath.Combine (path), baseRecursiveDir, filePath, func, directoryExcludeRegex));
}
return res;