Skip to content

Commit 88c27a6

Browse files
authored
Resolve dependency graph items reduce allocation size (#7174)
1 parent d2887cd commit 88c27a6

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.cs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,10 +1000,7 @@ private async Task<Dictionary<LibraryDependencyIndex, ResolvedDependencyGraphIte
10001000
{
10011001
IsCentrallyPinnedTransitivePackage = currentDependencyGraphItem.IsCentrallyPinnedTransitivePackage,
10021002
IsRootPackageReference = currentDependencyGraphItem.IsRootPackageReference,
1003-
Suppressions = new List<HashSet<LibraryDependencyIndex>>
1004-
{
1005-
currentDependencyGraphItem.Suppressions!
1006-
}
1003+
Suppressions = [currentDependencyGraphItem.Suppressions!],
10071004
};
10081005

10091006
resolvedDependencyGraphItems.Add(currentDependencyGraphItem.LibraryDependencyIndex, chosenResolvedItem);
@@ -1147,10 +1144,7 @@ private async Task<Dictionary<LibraryDependencyIndex, ResolvedDependencyGraphIte
11471144
{
11481145
IsCentrallyPinnedTransitivePackage = currentDependencyGraphItem.IsCentrallyPinnedTransitivePackage,
11491146
IsRootPackageReference = currentDependencyGraphItem.IsRootPackageReference,
1150-
Suppressions = new List<HashSet<LibraryDependencyIndex>>
1151-
{
1152-
currentDependencyGraphItem.Suppressions!
1153-
},
1147+
Suppressions = [currentDependencyGraphItem.Suppressions!],
11541148
};
11551149

11561150
resolvedDependencyGraphItems.Add(currentDependencyGraphItem.LibraryDependencyIndex, chosenResolvedItem);
@@ -1207,10 +1201,7 @@ private async Task<Dictionary<LibraryDependencyIndex, ResolvedDependencyGraphIte
12071201
{
12081202
IsCentrallyPinnedTransitivePackage = chosenResolvedItem.IsCentrallyPinnedTransitivePackage,
12091203
IsRootPackageReference = chosenResolvedItem.IsRootPackageReference,
1210-
Suppressions = new List<HashSet<LibraryDependencyIndex>>
1211-
{
1212-
currentDependencyGraphItem.Suppressions,
1213-
},
1204+
Suppressions = [currentDependencyGraphItem.Suppressions],
12141205
};
12151206

12161207
resolvedDependencyGraphItems.Add(currentDependencyGraphItem.LibraryDependencyIndex, chosenResolvedItem);

0 commit comments

Comments
 (0)