From 51e7d00c4810c91ba7a76f7587d567ed69512dbc Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Thu, 14 Nov 2024 18:36:02 +0000 Subject: [PATCH] refactor: remove zombie Span.Replace --- X10D/src/Collections/SpanExtensions.cs | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/X10D/src/Collections/SpanExtensions.cs b/X10D/src/Collections/SpanExtensions.cs index 80add99..427a1fc 100644 --- a/X10D/src/Collections/SpanExtensions.cs +++ b/X10D/src/Collections/SpanExtensions.cs @@ -16,28 +16,6 @@ public static class SpanExtensions return source; } -#if !NET8_0_OR_GREATER - /// - /// Replaces all occurrences of a specified element in a span of elements with another specified element. - /// - /// The source span. - /// The element to replace. - /// The replacement element. - /// The type of elements in . - public static void Replace(this Span haystack, T needle, T replacement) where T : struct - { - var comparer = EqualityComparer.Default; - - for (var index = 0; index < haystack.Length; index++) - { - if (comparer.Equals(haystack[index], needle)) - { - haystack[index] = replacement; - } - } - } -#endif - #if !NET9_0_OR_GREATER /// /// Splits a span of elements into sub-spans based on a delimiting element.