Browse Source

Merge pull request #1831 from Despacito696969/master

Fixed `slice.is_sorted_cmp`
gingerBill 3 years ago
parent
commit
bfcb527b42
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/slice/sort.odin

+ 1 - 1
core/slice/sort.odin

@@ -103,7 +103,7 @@ is_sorted_by :: proc(array: $T/[]$E, less: proc(i, j: E) -> bool) -> bool {
 is_sorted_by_cmp :: is_sorted_cmp
 is_sorted_cmp :: proc(array: $T/[]$E, cmp: proc(i, j: E) -> Ordering) -> bool {
 	for i := len(array)-1; i > 0; i -= 1 {
-		if cmp(array[i], array[i-1]) == .Equal {
+		if cmp(array[i], array[i-1]) == .Less {
 			return false
 		}
 	}