File tree Expand file tree Collapse file tree
src/NuGet.Core/NuGet.Commands/RestoreCommand Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1255,11 +1255,7 @@ .. chosenResolvedItem.Suppressions
12551255 if ( isRootProject )
12561256 {
12571257
1258- #if NETSTANDARD
1259- directPackageReferences = new HashSet < LibraryDependencyIndex > ( ) ;
1260- #else
12611258 directPackageReferences = new HashSet < LibraryDependencyIndex > ( capacity : chosenResolvedItem . Item . Data . Dependencies . Count ) ;
1262- #endif
12631259
12641260 for ( int i = 0 ; i < chosenResolvedItem . Item . Data . Dependencies . Count ; i ++ )
12651261 {
@@ -1293,7 +1289,7 @@ .. chosenResolvedItem.Suppressions
12931289 // Suppress this dependency if PrivateAssets is set to "All"
12941290 if ( dependency . SuppressParent == LibraryIncludeFlags . All )
12951291 {
1296- suppressions ??= new HashSet < LibraryDependencyIndex > ( ) ;
1292+ suppressions ??= new HashSet < LibraryDependencyIndex > ( capacity : chosenResolvedItem . Item . Data . Dependencies . Count - i ) ;
12971293
12981294 suppressions . Add ( chosenResolvedItemChildLibraryDependencyIndex ) ;
12991295 }
You can’t perform that action at this time.
0 commit comments