mirror of
https://github.com/duke-git/lancet.git
synced 2025-10-06 16:06:54 +08:00
fix: fix InsertionSort bug
This commit is contained in:
@@ -37,7 +37,7 @@ func InsertionSort[T any](slice []T, comparator lancetconstraints.Comparator) []
|
||||
preIndex--
|
||||
}
|
||||
|
||||
slice[preIndex+1] = preItem
|
||||
slice[preIndex+1] = currentItem
|
||||
}
|
||||
|
||||
return slice
|
||||
|
Reference in New Issue
Block a user