diff --git a/Changelog.md b/Changelog.md index 7c4583d..9d7e804 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) from v2.0 onwards. +## [2.0.1] - 2025-9-28 + +### Fixed + +- a bug in Min() in .net7.0. + ## [2.0.0] - 2025-9-28 ### Fixed @@ -34,7 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - incorrect ranges returned by the range-based Split method for versions prior to .Net 9. -### Changed +### Changed - moved MemoryExtensions containing range-based Split method for versions prior to .Net 9 from `System` to `SpanExtensions`. - grammatical issues in some documentation comments. diff --git a/src/Extensions/ReadOnlySpan/Linq/Min.cs b/src/Extensions/ReadOnlySpan/Linq/Min.cs index 9067e6b..7f3c231 100644 --- a/src/Extensions/ReadOnlySpan/Linq/Min.cs +++ b/src/Extensions/ReadOnlySpan/Linq/Min.cs @@ -177,7 +177,7 @@ public static T Min(this ReadOnlySpan source) where T : IComparable { T current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -292,7 +292,7 @@ public static byte Min(this ReadOnlySpan source) { byte current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -407,7 +407,7 @@ public static ushort Min(this ReadOnlySpan source) { ushort current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -522,7 +522,7 @@ public static uint Min(this ReadOnlySpan source) { uint current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -606,7 +606,7 @@ public static ulong Min(this ReadOnlySpan source) { ulong current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -721,7 +721,7 @@ public static sbyte Min(this ReadOnlySpan source) { sbyte current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -836,7 +836,7 @@ public static short Min(this ReadOnlySpan source) { short current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -951,7 +951,7 @@ public static int Min(this ReadOnlySpan source) { int current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -1035,7 +1035,7 @@ public static long Min(this ReadOnlySpan source) { long current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -1150,7 +1150,7 @@ public static float Min(this ReadOnlySpan source) { float current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } @@ -1234,7 +1234,7 @@ public static double Min(this ReadOnlySpan source) { double current = source[i]; - if(current.CompareTo(min) > 0) + if(current.CompareTo(min) < 0) { min = current; } diff --git a/src/SpanExtensions.csproj b/src/SpanExtensions.csproj index c710590..abeb200 100644 --- a/src/SpanExtensions.csproj +++ b/src/SpanExtensions.csproj @@ -20,7 +20,7 @@ Span;Performance;Extension;String https://github.com/draconware-dev/SpanExtensions.Net/blob/main/Changelog.md LICENSE - 2.0.0 + 2.0.1 SpanExtensions.Net README.md icon.png