Skip to content

Commit ac56ea8

Browse files
committed
Small tweak
1 parent 7075193 commit ac56ea8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,14 @@ public async Task<string> DownloadPackageAsync(PackageId packageId,
9393

9494
SourceRepository repository = GetSourceRepository(source);
9595

96-
if (isTool && await repository.GetResourceAsync<PackageSearchResourceV3>(cancellationToken).ConfigureAwait(false) is var searchResource)
96+
if (isTool && await repository.GetResourceAsync<PackageSearchResourceV3>(cancellationToken).ConfigureAwait(false) is var searchResource)
9797
{
9898
var results = await searchResource.SearchAsync(packageId.ToString(), new SearchFilter(includePrerelease: includePreview, filter: SearchFilterType.IsLatestVersion)
9999
{
100100
PackageTypes = [NuGet.Packaging.Core.PackageType.DotnetTool.Name]
101101
}, skip: 0, take: 10, log: _verboseLogger, cancellationToken: cancellationToken).ConfigureAwait(false);
102-
if (results.Count() == 0)
102+
103+
if (!results.Any())
103104
{
104105
throw new ToolPackageException(string.Format(LocalizableStrings.NotATool, packageId));
105106
}

0 commit comments

Comments
 (0)