From 8ba57c8b55493f51396ca9c253abea7c88904da5 Mon Sep 17 00:00:00 2001 From: therzok Date: Sun, 21 Jul 2019 12:57:02 +0300 Subject: [Core] Small cleanups in DefaultMSBuildEngine Unroll LINQ in a loop code, use lambda instead of delegate notation and remove an unused method --- .../MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs') 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 1c14ad2329..1d488525cf 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs @@ -519,7 +519,10 @@ namespace MonoDevelop.Projects.MSBuild { var exclude = ExcludeToRegex (remove); do { - foreach (var globInclude in project.GlobIncludes.Where (g => g.Item.Name == item.Name)) { + foreach (var globInclude in project.GlobIncludes) { + if (globInclude.Item.Name != item.Name) + continue; + if (globInclude.RemoveRegex != null) exclude = globInclude.RemoveRegex + "|" + exclude; globInclude.RemoveRegex = new Regex (exclude); @@ -867,10 +870,8 @@ namespace MonoDevelop.Projects.MSBuild static IEnumerable GetIncludesForWildcardFilePath (MSBuildProject project, string path, Regex directoryExcludeRegex = null) { var subpath = SplitWildcardFilePath (path); - - WildcardExpansionFunc func = delegate (string file, string include, string recursiveDir) { - return include; - }; + + WildcardExpansionFunc func = (file, include, recursiveDir) => include; return ExpandWildcardFilePath (project, project.BaseDirectory, FilePath.Null, false, subpath.AsSpan (), func, directoryExcludeRegex); } @@ -1033,11 +1034,6 @@ namespace MonoDevelop.Projects.MSBuild } } - MSBuildItemEvaluated Evaluate (ProjectInfo project, MSBuildEvaluationContext context, MSBuildItem item) - { - return CreateEvaluatedItem (context, project, project.Project, item, context.EvaluateString (item.Include)); - } - IReadOnlyList GetImportedProjects (ProjectInfo project, MSBuildImport import) { List prefProjects; -- cgit v1.2.3