diff options
author | therzok <marius.ungureanu@xamarin.com> | 2019-07-21 04:36:22 +0300 |
---|---|---|
committer | therzok <marius.ungureanu@xamarin.com> | 2019-07-21 06:42:54 +0300 |
commit | ea855c0ac90842f77fbbb77bc55c8b6413f1fbc0 (patch) | |
tree | 532adf7747611485f40a0dfeeb762ed43ae35a3d /main/src | |
parent | acd388255b89d19ccf8247ceb64db382d7f777cd (diff) |
[Core] Avoid allocating strings for keys when loading the MSBuild project
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs index 7c8df89ff8..a23254c86c 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs @@ -145,13 +145,13 @@ namespace MonoDevelop.Projects.MSBuild } } - var evalItems = new Dictionary<string,MSBuildItemEvaluated> (); + var evalItems = new Dictionary<(string, string),MSBuildItemEvaluated> (); foreach (var it in e.GetEvaluatedItems (project)) { var xit = it as MSBuildItemEvaluated; if (xit == null) { xit = CreateEvaluatedItem (e, it); var itemId = e.GetItemMetadata (it, NodeIdPropertyName); - var key = itemId + " " + xit.Include; + var key = (itemId, xit.Include); if (evalItems.ContainsKey (key)) continue; // xbuild seems to return duplicate items when using wildcards. This is a workaround to avoid the duplicates. MSBuildItem pit; @@ -164,14 +164,14 @@ namespace MonoDevelop.Projects.MSBuild evaluatedItems.Add (xit); } - var evalItemsNoCond = new Dictionary<string,MSBuildItemEvaluated> (); + var evalItemsNoCond = new Dictionary<(string, string),MSBuildItemEvaluated> (); foreach (var it in e.GetEvaluatedItemsIgnoringCondition (project)) { var xit = it as MSBuildItemEvaluated; if (xit == null) { xit = CreateEvaluatedItem (e, it); var itemId = e.GetItemMetadata (it, NodeIdPropertyName); MSBuildItemEvaluated evItem; - var key = itemId + " " + xit.Include; + var key = (itemId, xit.Include); if (evalItemsNoCond.ContainsKey (key)) continue; // xbuild seems to return duplicate items when using wildcards. This is a workaround to avoid the duplicates. if (!string.IsNullOrEmpty (itemId) && evalItems.TryGetValue (key, out evItem)) { |