From 80a84c0803c6c57dbbf26e175cfbcf21eb244301 Mon Sep 17 00:00:00 2001 From: 0syntrax0 <5194293+0syntrax0@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:47:55 -0500 Subject: [PATCH] switching to use 'sliceStable' --- slices.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slices.go b/slices.go index 88f445b..0101cf6 100644 --- a/slices.go +++ b/slices.go @@ -8,14 +8,14 @@ import ( // sort any slice ASENDING func SortSliceASC[T constraints.Ordered](s []T) { - sort.Slice(s, func(i, j int) bool { + sort.SliceStable(s, func(i, j int) bool { return s[i] < s[j] }) } // sort any slice DESCENDING func SortSliceDESC[T constraints.Ordered](s []T) { - sort.Slice(s, func(i, j int) bool { + sort.SliceStable(s, func(i, j int) bool { return s[i] > s[j] }) }