From 52f705d2390a26aac4919099621a86e6a6110176 Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Thu, 12 Jan 2023 21:46:34 +0100 Subject: [PATCH] Seal (private) enumerators --- MoreLinq/Permutations.cs | 2 +- MoreLinq/Subsets.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MoreLinq/Permutations.cs b/MoreLinq/Permutations.cs index 0fac1001b..b700e46fc 100644 --- a/MoreLinq/Permutations.cs +++ b/MoreLinq/Permutations.cs @@ -29,7 +29,7 @@ public static partial class MoreEnumerable /// The private implementation class that produces permutations of a sequence. /// - class PermutationEnumerator : IEnumerator> + sealed class PermutationEnumerator : IEnumerator> { // NOTE: The algorithm used to generate permutations uses the fact that any set // can be put into 1-to-1 correspondence with the set of ordinals number (0..n). diff --git a/MoreLinq/Subsets.cs b/MoreLinq/Subsets.cs index 357a60f73..3ddf9f49a 100644 --- a/MoreLinq/Subsets.cs +++ b/MoreLinq/Subsets.cs @@ -123,7 +123,7 @@ sealed class SubsetGenerator : IEnumerable> /// predetermined size less than or equal to the original set size. /// - class SubsetEnumerator : IEnumerator> + sealed class SubsetEnumerator : IEnumerator> { readonly IList _set; // the original set of elements readonly T[] _subset; // the current subset to return