fix for latest Nim compiler
This commit is contained in:
parent
d7202861da
commit
6c150113e8
1 changed files with 3 additions and 3 deletions
|
|
@ -95,7 +95,7 @@ template minIndex*(seq1, el, op: untyped): untyped =
|
||||||
result = cmp(a, b))
|
result = cmp(a, b))
|
||||||
result
|
result
|
||||||
|
|
||||||
func maxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure.}): T =
|
func maxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure, noSideEffect.}): T =
|
||||||
## Returns the maximum value of all elements in s.
|
## Returns the maximum value of all elements in s.
|
||||||
## Comparison is done by cmp() proc.
|
## Comparison is done by cmp() proc.
|
||||||
##
|
##
|
||||||
|
|
@ -110,7 +110,7 @@ func maxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure.}): T =
|
||||||
if cmp(s[i], result) > 0:
|
if cmp(s[i], result) > 0:
|
||||||
result = s[i]
|
result = s[i]
|
||||||
|
|
||||||
func minValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure.}): T =
|
func minValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure, noSideEffect.}): T =
|
||||||
## Returns the minimum value of all elements in s.
|
## Returns the minimum value of all elements in s.
|
||||||
## Comparison is done by cmp() proc.
|
## Comparison is done by cmp() proc.
|
||||||
##
|
##
|
||||||
|
|
@ -189,7 +189,7 @@ template minValue*(seq1, el, op: untyped): untyped =
|
||||||
result = cmp(a, b))
|
result = cmp(a, b))
|
||||||
result
|
result
|
||||||
|
|
||||||
func minMaxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure.}): (T, T) =
|
func minMaxValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure, noSideEffect.}): (T, T) =
|
||||||
## Returns the minimum and maximum values of all elements in s.
|
## Returns the minimum and maximum values of all elements in s.
|
||||||
## Comparison is done by cmp() proc.
|
## Comparison is done by cmp() proc.
|
||||||
##
|
##
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue