From 700be8fb5d2177e3b558a34a5e3bc396d165f9ea Mon Sep 17 00:00:00 2001 From: Levonap Date: Sun, 14 Sep 2025 12:33:47 +0300 Subject: [PATCH] satisfy CA1829 for C# binary search CA1829: Use Length/Count property instead of Enumerable.Count method https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1829 --- .../csharp/01_binary_search/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01_introduction_to_algorithms/csharp/01_binary_search/Program.cs b/01_introduction_to_algorithms/csharp/01_binary_search/Program.cs index 97107a44..65bf0132 100644 --- a/01_introduction_to_algorithms/csharp/01_binary_search/Program.cs +++ b/01_introduction_to_algorithms/csharp/01_binary_search/Program.cs @@ -16,7 +16,7 @@ public static void Main(string[] args) private static int? BinarySearch(IList list, int item) { var low = 0; - var high = list.Count() - 1; + var high = list.Count - 1; while (low <= high) {