diff options
author | Yuriy Glukhov <yglukhov@users.noreply.github.com> | 2018-03-16 17:22:45 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-03-16 16:22:45 +0100 |
commit | 5ea80b43b1805003d8c06ac5122c6e698c959f52 (patch) | |
tree | 5044032b29032bd378790473c6be72219210f045 /lib/pure | |
parent | 70b28a39fedfe030ac4e1615d32328d7ffd3f79d (diff) | |
download | Nim-5ea80b43b1805003d8c06ac5122c6e698c959f52.tar.gz |
More flexible lowerBound interface (#7344)
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/algorithm.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index 23a0cdb02..2f7b44b31 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -84,7 +84,7 @@ proc smartBinarySearch*[T](a: openArray[T], key: T): int = const onlySafeCode = true -proc lowerBound*[T](a: openArray[T], key: T, cmp: proc(x,y: T): int {.closure.}): int = +proc lowerBound*[T, K](a: openArray[T], key: K, cmp: proc(x: T, k: K): int {.closure.}): int = ## same as binarySearch except that if key is not in `a` then this ## returns the location where `key` would be if it were. In other ## words if you have a sorted sequence and you call |