From f6aa52d666934e3b34b2f10d9002b12d7f421595 Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Mon, 23 Oct 2023 20:44:08 +0200 Subject: [PATCH 1/2] Remove "Windowed" that's superseded "Window" --- .../PublicAPI/net6.0/PublicAPI.Unshipped.txt | 1 + .../netstandard2.0/PublicAPI.Unshipped.txt | 1 + .../netstandard2.1/PublicAPI.Unshipped.txt | 1 + MoreLinq/Window.cs | 20 ------------------- README.md | 3 +-- 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt b/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt index fb44539c9..c2a9e629e 100644 --- a/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt +++ b/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt @@ -12,6 +12,7 @@ *REMOVED*static MoreLinq.MoreEnumerable.TakeLast(this System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable! *REMOVED*static MoreLinq.MoreEnumerable.ToHashSet(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.HashSet! *REMOVED*static MoreLinq.MoreEnumerable.ToHashSet(this System.Collections.Generic.IEnumerable! source, System.Collections.Generic.IEqualityComparer? comparer) -> System.Collections.Generic.HashSet! +*REMOVED*static MoreLinq.MoreEnumerable.Windowed(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable!>! static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size, System.Func! resultSelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.Append(System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! diff --git a/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt index ecb558421..fa0a2a28d 100644 --- a/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt +++ b/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt @@ -6,6 +6,7 @@ *REMOVED*static MoreLinq.MoreEnumerable.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable!>! *REMOVED*static MoreLinq.MoreEnumerable.Concat(this System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! *REMOVED*static MoreLinq.MoreEnumerable.Prepend(this System.Collections.Generic.IEnumerable! source, TSource value) -> System.Collections.Generic.IEnumerable! +*REMOVED*static MoreLinq.MoreEnumerable.Windowed(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable!>! static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size, System.Func! resultSelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.Append(System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! diff --git a/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt b/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt index b2858b738..85be22323 100644 --- a/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt +++ b/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt @@ -10,6 +10,7 @@ *REMOVED*static MoreLinq.MoreEnumerable.TakeLast(this System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable! *REMOVED*static MoreLinq.MoreEnumerable.ToHashSet(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.HashSet! *REMOVED*static MoreLinq.MoreEnumerable.ToHashSet(this System.Collections.Generic.IEnumerable! source, System.Collections.Generic.IEqualityComparer? comparer) -> System.Collections.Generic.HashSet! +*REMOVED*static MoreLinq.MoreEnumerable.Windowed(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable!>! static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size, System.Func! resultSelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.Append(System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! diff --git a/MoreLinq/Window.cs b/MoreLinq/Window.cs index b7db91a85..04b1ddefd 100644 --- a/MoreLinq/Window.cs +++ b/MoreLinq/Window.cs @@ -73,25 +73,5 @@ public static IEnumerable> Window(this IEnumerable - /// Processes a sequence into a series of sub-sequences representing a windowed subset of the original. - /// - /// The type of the elements of the source sequence. - /// The sequence to evaluate a sliding window over. - /// The size (number of elements) in each window. - /// - /// A series of sequences representing each sliding window subsequence. - /// - /// - /// The number of sequences returned is: Max(0, sequence.Count() - windowSize) + - /// 1 - /// - /// Returned sub-sequences are buffered, but the overall operation is streamed. - /// - - [Obsolete("Use " + nameof(Window) + " instead.")] - public static IEnumerable> Windowed(this IEnumerable source, int size) => - source.Window(size); } } diff --git a/README.md b/README.md index 9d1f76a44..de6b4e622 100644 --- a/README.md +++ b/README.md @@ -693,8 +693,7 @@ subset of the original Processes a sequence into a series of subsequences representing a windowed subset of the original -This method is obsolete and will be removed in a future version. Use `Window` -instead. +This method was removed and has been superseded by [`Window`](#window) instead. ### WindowLeft From c5aa8406b8aec7c6ea9c8eeef92c93da4d9dd43f Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Mon, 23 Oct 2023 21:04:55 +0200 Subject: [PATCH 2/2] Update compatibility suppressions --- MoreLinq/CompatibilitySuppressions.xml | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/MoreLinq/CompatibilitySuppressions.xml b/MoreLinq/CompatibilitySuppressions.xml index 689b85169..ead8c1613 100644 --- a/MoreLinq/CompatibilitySuppressions.xml +++ b/MoreLinq/CompatibilitySuppressions.xml @@ -92,6 +92,13 @@ lib/netstandard2.0/MoreLinq.dll true + + CP0002 + M:MoreLinq.MoreEnumerable.Windowed``1(System.Collections.Generic.IEnumerable{``0},System.Int32) + lib/net462/MoreLinq.dll + lib/netstandard2.0/MoreLinq.dll + true + CP0002 M:MoreLinq.Extensions.BatchExtension.Batch``2(System.Collections.Generic.IEnumerable{``0},System.Int32,System.Func{System.Collections.Generic.IEnumerable{``0},``1}) @@ -127,6 +134,13 @@ lib/net6.0/MoreLinq.dll true + + CP0002 + M:MoreLinq.MoreEnumerable.Windowed``1(System.Collections.Generic.IEnumerable{``0},System.Int32) + lib/net6.0/MoreLinq.dll + lib/net6.0/MoreLinq.dll + true + CP0002 M:MoreLinq.Extensions.BatchExtension.Batch``2(System.Collections.Generic.IEnumerable{``0},System.Int32,System.Func{System.Collections.Generic.IEnumerable{``0},``1}) @@ -162,6 +176,13 @@ lib/netstandard2.0/MoreLinq.dll true + + CP0002 + M:MoreLinq.MoreEnumerable.Windowed``1(System.Collections.Generic.IEnumerable{``0},System.Int32) + lib/netstandard2.0/MoreLinq.dll + lib/netstandard2.0/MoreLinq.dll + true + CP0002 M:MoreLinq.Extensions.BatchExtension.Batch``2(System.Collections.Generic.IEnumerable{``0},System.Int32,System.Func{System.Collections.Generic.IEnumerable{``0},``1}) @@ -197,6 +218,13 @@ lib/netstandard2.1/MoreLinq.dll true + + CP0002 + M:MoreLinq.MoreEnumerable.Windowed``1(System.Collections.Generic.IEnumerable{``0},System.Int32) + lib/netstandard2.1/MoreLinq.dll + lib/netstandard2.1/MoreLinq.dll + true + PKV006 .NETStandard,Version=v1.0