From 738dc2c98ce0a67065a05305149ab2e3c044d8cb Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 9 Jan 2023 22:03:34 -0600 Subject: [PATCH] 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. --- .editorconfig | 1 - src/Sonarr.Api.V3/System/Backup/BackupController.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 58a294dc1..14d87d1b0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -194,7 +194,6 @@ dotnet_diagnostic.CA1819.severity = suggestion dotnet_diagnostic.CA1822.severity = suggestion dotnet_diagnostic.CA1823.severity = suggestion dotnet_diagnostic.CA1824.severity = suggestion -dotnet_diagnostic.CA1826.severity = suggestion dotnet_diagnostic.CA1827.severity = suggestion dotnet_diagnostic.CA1829.severity = suggestion dotnet_diagnostic.CA1834.severity = suggestion diff --git a/src/Sonarr.Api.V3/System/Backup/BackupController.cs b/src/Sonarr.Api.V3/System/Backup/BackupController.cs index e20a732c5..aaae25b01 100644 --- a/src/Sonarr.Api.V3/System/Backup/BackupController.cs +++ b/src/Sonarr.Api.V3/System/Backup/BackupController.cs @@ -93,7 +93,7 @@ namespace Sonarr.Api.V3.System.Backup throw new BadRequestException("file must be provided"); } - var file = files.First(); + var file = files[0]; var extension = Path.GetExtension(file.FileName); if (!ValidExtensions.Contains(extension))