1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-29 23:12:39 +01:00
Commit Graph

15 Commits

Author SHA1 Message Date
Qstick
e805f61450 Use Length/Count property instead of Count() method to prevent enumerating 2023-03-15 19:24:48 -05:00
Qstick
4fe9daec03 Use Any() in place of Count() to prevent enumerating
This rule flags the Count and LongCount LINQ method calls used to check if the collection has at least one element. These method calls require enumerating the entire collection to compute the count. The same check is faster with the Any method as it avoids enumerating the collection.
2023-03-15 19:24:48 -05:00
Qstick
738dc2c98c 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.
2023-03-15 19:24:48 -05:00
Qstick
0ed8ba828d Avoid unnecessary zero-length array allocations 2023-03-15 19:24:48 -05:00
Qstick
b2c2c79a96 Don't compare strings to Empty using Equals
Comparing strings using the String.Length property or the String.IsNullOrEmpty method is faster than using Equals. This is because Equals executes significantly more MSIL instructions than either IsNullOrEmpty or the number of instructions executed to retrieve the Length property value and compare it to zero.
2023-03-15 19:24:48 -05:00
Qstick
08ee2f7e32 Remove unnecessary assignments to default type value
The .NET runtime initializes all fields of reference types to their default values before running the constructor. In most cases, explicitly initializing a field to its default value in a constructor is redundant, adding maintenance costs and potentially degrading performance
2023-03-15 19:24:48 -05:00
Qstick
42e45f93ac Use const where appropriate
The value of a const field is computed at compile time and stored in the metadata, which improves run-time performance when it is compared to a static readonly field.
2023-03-15 19:24:48 -05:00
Qstick
b4d8f0c311 Enable all analyzers and enforce code style on build 2023-03-15 19:24:48 -05:00
Qstick
08b677ca7d Enforce comment spacing with Stylecop 2022-11-21 16:58:07 -08:00
Qstick
4c0fe62dda Use modern HttpClient
Co-Authored-By: ta264 <ta264@users.noreply.github.com>
2022-08-07 15:24:37 -07:00
Qstick
1c22a1ec0d StyleCop 2022-08-07 15:24:35 -07:00
Qstick
878d1561aa Build Sonarr on Net6
Co-Authored-By: ta264 <ta264@users.noreply.github.com>
2022-08-07 15:04:46 -07:00
Taloth Saldono
feebb349d5 Linting error. 2019-03-09 00:21:06 +01:00
Taloth Saldono
e8161aa9f4 Added specific external updater messages for Apt and Docker. 2018-12-29 13:51:34 +01:00
Taloth Saldono
206ff12b71 Added .editorconfig 2016-08-13 22:22:24 +02:00