From cf0afd57072e5199ce0d86adf46053f072080426 Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Fri, 4 Nov 2022 08:20:06 +0100 Subject: [PATCH 1/2] Simplify names (IDE0001) https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0001 --- MoreLinq.Test/ToDataTableTest.cs | 2 +- MoreLinq/Lookup.cs | 2 +- MoreLinq/PartialSort.cs | 8 ++++---- MoreLinq/PreScan.cs | 2 +- MoreLinq/Scan.cs | 2 +- MoreLinq/ScanRight.cs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/MoreLinq.Test/ToDataTableTest.cs b/MoreLinq.Test/ToDataTableTest.cs index 6281c01f1..b2d43b168 100644 --- a/MoreLinq.Test/ToDataTableTest.cs +++ b/MoreLinq.Test/ToDataTableTest.cs @@ -71,7 +71,7 @@ public void ToDataTableNullMemberExpressionMethod() Expression> expression = null; AssertThrowsArgument.Exception("expressions",() => - _testObjects.ToDataTable(expression)); + _testObjects.ToDataTable(expression)); } [Test] diff --git a/MoreLinq/Lookup.cs b/MoreLinq/Lookup.cs index c576d99a2..5373f28b7 100644 --- a/MoreLinq/Lookup.cs +++ b/MoreLinq/Lookup.cs @@ -117,7 +117,7 @@ public IEnumerable ApplyResultSelector(Func(ref g.elements, g.count); } + if (g.count != g.elements.Length) { Array.Resize(ref g.elements, g.count); } yield return resultSelector(g.key, g.elements); } while (g != _lastGrouping); } diff --git a/MoreLinq/PartialSort.cs b/MoreLinq/PartialSort.cs index e8010510f..0344141a5 100644 --- a/MoreLinq/PartialSort.cs +++ b/MoreLinq/PartialSort.cs @@ -43,7 +43,7 @@ public static IEnumerable PartialSort(this IEnumerable source, int coun } /// - /// Combines , + /// Combines , /// where each element is its key, and /// in a single operation. /// An additional parameter specifies the direction of the sort @@ -88,7 +88,7 @@ public static IEnumerable PartialSort(this IEnumerable source, } /// - /// Combines , + /// Combines , /// where each element is its key, and /// in a single operation. /// Additional parameters specify how the elements compare to each other and @@ -137,7 +137,7 @@ public static IEnumerable PartialSortBy( } /// - /// Combines , + /// Combines , /// and in a single operation. /// An additional parameter specifies the direction of the sort /// @@ -188,7 +188,7 @@ public static IEnumerable PartialSortBy( } /// - /// Combines , + /// Combines , /// and in a single operation. /// Additional parameters specify how the elements compare to each other and /// the direction of the sort. diff --git a/MoreLinq/PreScan.cs b/MoreLinq/PreScan.cs index 88aa8f57c..28ab32c21 100644 --- a/MoreLinq/PreScan.cs +++ b/MoreLinq/PreScan.cs @@ -31,7 +31,7 @@ static partial class MoreEnumerable /// element is a special case, it is set to the identity). More /// generally, the pre-scan allows any commutative binary operation, /// not just a sum. - /// The inclusive version of PreScan is . + /// The inclusive version of PreScan is . /// This operator uses deferred execution and streams its result. /// /// diff --git a/MoreLinq/Scan.cs b/MoreLinq/Scan.cs index a14ffe599..a67da62af 100644 --- a/MoreLinq/Scan.cs +++ b/MoreLinq/Scan.cs @@ -31,7 +31,7 @@ static partial class MoreEnumerable /// N-th element is the sum of the first N input elements. More /// generally, the scan allows any commutative binary operation, not /// just a sum. - /// The exclusive version of Scan is . + /// The exclusive version of Scan is . /// This operator uses deferred execution and streams its result. /// /// diff --git a/MoreLinq/ScanRight.cs b/MoreLinq/ScanRight.cs index 131aced3c..68650e640 100644 --- a/MoreLinq/ScanRight.cs +++ b/MoreLinq/ScanRight.cs @@ -25,7 +25,7 @@ static partial class MoreEnumerable /// /// Peforms a right-associative scan (inclusive prefix) on a sequence of elements. /// This operator is the right-associative version of the - /// LINQ operator. + /// LINQ operator. /// /// Type of elements in source sequence. /// Source sequence. @@ -60,7 +60,7 @@ public static IEnumerable ScanRight(this IEnumerable /// Peforms a right-associative scan (inclusive prefix) on a sequence of elements. /// The specified seed value is used as the initial accumulator value. /// This operator is the right-associative version of the - /// LINQ operator. + /// LINQ operator. /// /// The type of the elements of source. /// The type of the accumulator value. From d66dc6477c5878ec87554299a0919f3080fa6a1b Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Fri, 4 Nov 2022 22:38:56 +0100 Subject: [PATCH 2/2] Revert changes in XML doc comments --- MoreLinq/PartialSort.cs | 8 ++++---- MoreLinq/PreScan.cs | 2 +- MoreLinq/Scan.cs | 2 +- MoreLinq/ScanRight.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MoreLinq/PartialSort.cs b/MoreLinq/PartialSort.cs index 0344141a5..e8010510f 100644 --- a/MoreLinq/PartialSort.cs +++ b/MoreLinq/PartialSort.cs @@ -43,7 +43,7 @@ public static IEnumerable PartialSort(this IEnumerable source, int coun } /// - /// Combines , + /// Combines , /// where each element is its key, and /// in a single operation. /// An additional parameter specifies the direction of the sort @@ -88,7 +88,7 @@ public static IEnumerable PartialSort(this IEnumerable source, } /// - /// Combines , + /// Combines , /// where each element is its key, and /// in a single operation. /// Additional parameters specify how the elements compare to each other and @@ -137,7 +137,7 @@ public static IEnumerable PartialSortBy( } /// - /// Combines , + /// Combines , /// and in a single operation. /// An additional parameter specifies the direction of the sort /// @@ -188,7 +188,7 @@ public static IEnumerable PartialSortBy( } /// - /// Combines , + /// Combines , /// and in a single operation. /// Additional parameters specify how the elements compare to each other and /// the direction of the sort. diff --git a/MoreLinq/PreScan.cs b/MoreLinq/PreScan.cs index 28ab32c21..88aa8f57c 100644 --- a/MoreLinq/PreScan.cs +++ b/MoreLinq/PreScan.cs @@ -31,7 +31,7 @@ static partial class MoreEnumerable /// element is a special case, it is set to the identity). More /// generally, the pre-scan allows any commutative binary operation, /// not just a sum. - /// The inclusive version of PreScan is . + /// The inclusive version of PreScan is . /// This operator uses deferred execution and streams its result. /// /// diff --git a/MoreLinq/Scan.cs b/MoreLinq/Scan.cs index 7ddc8d8f9..50a8ac4d0 100644 --- a/MoreLinq/Scan.cs +++ b/MoreLinq/Scan.cs @@ -31,7 +31,7 @@ static partial class MoreEnumerable /// N-th element is the sum of the first N input elements. More /// generally, the scan allows any commutative binary operation, not /// just a sum. - /// The exclusive version of Scan is . + /// The exclusive version of Scan is . /// This operator uses deferred execution and streams its result. /// /// diff --git a/MoreLinq/ScanRight.cs b/MoreLinq/ScanRight.cs index a8939cf79..d7c7b84a5 100644 --- a/MoreLinq/ScanRight.cs +++ b/MoreLinq/ScanRight.cs @@ -25,7 +25,7 @@ static partial class MoreEnumerable /// /// Peforms a right-associative scan (inclusive prefix) on a sequence of elements. /// This operator is the right-associative version of the - /// LINQ operator. + /// LINQ operator. /// /// Type of elements in source sequence. /// Source sequence. @@ -57,7 +57,7 @@ public static IEnumerable ScanRight(this IEnumerable /// Peforms a right-associative scan (inclusive prefix) on a sequence of elements. /// The specified seed value is used as the initial accumulator value. /// This operator is the right-associative version of the - /// LINQ operator. + /// LINQ operator. /// /// The type of the elements of source. /// The type of the accumulator value.