Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
22 changes: 11 additions & 11 deletions src/Extensions/ReadOnlySpan/Linq/Min.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static T Min<T>(this ReadOnlySpan<T> source) where T : IComparable<T>
{
T current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -292,7 +292,7 @@ public static byte Min(this ReadOnlySpan<byte> source)
{
byte current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -407,7 +407,7 @@ public static ushort Min(this ReadOnlySpan<ushort> source)
{
ushort current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -522,7 +522,7 @@ public static uint Min(this ReadOnlySpan<uint> source)
{
uint current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -606,7 +606,7 @@ public static ulong Min(this ReadOnlySpan<ulong> source)
{
ulong current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -721,7 +721,7 @@ public static sbyte Min(this ReadOnlySpan<sbyte> source)
{
sbyte current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -836,7 +836,7 @@ public static short Min(this ReadOnlySpan<short> source)
{
short current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -951,7 +951,7 @@ public static int Min(this ReadOnlySpan<int> source)
{
int current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -1035,7 +1035,7 @@ public static long Min(this ReadOnlySpan<long> source)
{
long current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -1150,7 +1150,7 @@ public static float Min(this ReadOnlySpan<float> source)
{
float current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down Expand Up @@ -1234,7 +1234,7 @@ public static double Min(this ReadOnlySpan<double> source)
{
double current = source[i];

if(current.CompareTo(min) > 0)
if(current.CompareTo(min) < 0)
{
min = current;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SpanExtensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageTags>Span;Performance;Extension;String</PackageTags>
<PackageReleaseNotes>https://github.com/draconware-dev/SpanExtensions.Net/blob/main/Changelog.md</PackageReleaseNotes>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
<PackageId>SpanExtensions.Net</PackageId>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
Expand Down