From 951a248600301cf1fecbc4438c34002421ee38bc Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Tue, 26 Nov 2024 21:45:23 +1100 Subject: [PATCH] remove redundant Count() in GlobalPackageFolderRepositories --- src/NuGet.Core/NuGet.PackageManagement/NuGetPackageManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NuGet.Core/NuGet.PackageManagement/NuGetPackageManager.cs b/src/NuGet.Core/NuGet.PackageManagement/NuGetPackageManager.cs index a0a795c2cc1..399a76bd0af 100644 --- a/src/NuGet.Core/NuGet.PackageManagement/NuGetPackageManager.cs +++ b/src/NuGet.Core/NuGet.PackageManagement/NuGetPackageManager.cs @@ -163,7 +163,7 @@ public IReadOnlyList GlobalPackageFolderRepositories var pathContext = NuGetPathContext.Create(Settings); // count = FallbackPackageFolders.Count + 1 for UserPackageFolder - var count = (pathContext.FallbackPackageFolders?.Count() ?? 0) + 1; + var count = pathContext.FallbackPackageFolders.Count + 1; var folders = new List(count) { pathContext.UserPackageFolder @@ -3477,7 +3477,7 @@ await BuildIntegratedRestoreUtility.ExecuteInitPs1ScriptsAsync( if (dgSpecForParents.Restore.Count > 0) { // Restore and commit the lock file to disk regardless of the result - // This will restore all parents in a single restore + // This will restore all parents in a single restore await DependencyGraphRestoreUtility.RestoreAsync( dgSpecForParents, referenceContext,