Skip to content

Commit

Permalink
use any to return faster
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrrm committed Jul 17, 2023
1 parent 0033d66 commit f44d471
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,13 @@ await _logger.RunWithProgressAsync(
{
if (isRestoreSucceeded)
{
var errors = restoreSummaries.SelectMany(summary => summary.Errors.Where(e => e.Code.Equals(NuGetLogCode.NU1901) || e.Code.Equals(NuGetLogCode.NU1902) || e.Code.Equals(NuGetLogCode.NU1903) || e.Code.Equals(NuGetLogCode.NU1904)));
var errors = restoreSummaries.Any(summary => summary.Errors.Any(e => e.Code.Equals(NuGetLogCode.NU1901) || e.Code.Equals(NuGetLogCode.NU1902) || e.Code.Equals(NuGetLogCode.NU1903) || e.Code.Equals(NuGetLogCode.NU1904)));

if (errors.Any())
if (errors)
{
await _infoBarService.Value.ShowInfoBar(t);
}
if (!errors.Any() && _infoBarService.IsValueCreated)
if (!errors && _infoBarService.IsValueCreated)
{
await _infoBarService.Value.HideInfoBar(t);
}
Expand Down

0 comments on commit f44d471

Please sign in to comment.