mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 15:31:28 +00:00
Removed redundant check
Loop takes care of it already
This commit is contained in:
@@ -240,8 +240,6 @@ template sortedByIt*(seq1, op: expr): expr =
|
||||
proc isSorted*[T](a: openarray[T],
|
||||
cmp: proc(x, y: T): int {.closure.},
|
||||
order = SortOrder.Ascending): bool =
|
||||
if len(a) <= 1: return true
|
||||
|
||||
result = true
|
||||
for i in 0..<len(a)-1:
|
||||
if cmp(a[i],a[i+1]) * order > 0:
|
||||
|
||||
Reference in New Issue
Block a user