Do not use Enumerable methods on indexable collections

This rule flags the Enumerable LINQ method calls on collections of types that have equivalent but more efficient properties to fetch the same data.
This commit is contained in:
Qstick 2023-01-09 22:03:34 -06:00
parent 0ed8ba828d
commit 738dc2c98c
2 changed files with 1 additions and 2 deletions

View File

@ -194,7 +194,6 @@ dotnet_diagnostic.CA1819.severity = suggestion
dotnet_diagnostic.CA1822.severity = suggestion dotnet_diagnostic.CA1822.severity = suggestion
dotnet_diagnostic.CA1823.severity = suggestion dotnet_diagnostic.CA1823.severity = suggestion
dotnet_diagnostic.CA1824.severity = suggestion dotnet_diagnostic.CA1824.severity = suggestion
dotnet_diagnostic.CA1826.severity = suggestion
dotnet_diagnostic.CA1827.severity = suggestion dotnet_diagnostic.CA1827.severity = suggestion
dotnet_diagnostic.CA1829.severity = suggestion dotnet_diagnostic.CA1829.severity = suggestion
dotnet_diagnostic.CA1834.severity = suggestion dotnet_diagnostic.CA1834.severity = suggestion

View File

@ -93,7 +93,7 @@ namespace Sonarr.Api.V3.System.Backup
throw new BadRequestException("file must be provided"); throw new BadRequestException("file must be provided");
} }
var file = files.First(); var file = files[0];
var extension = Path.GetExtension(file.FileName); var extension = Path.GetExtension(file.FileName);
if (!ValidExtensions.Contains(extension)) if (!ValidExtensions.Contains(extension))