diff options
Diffstat (limited to 'src/utils/map.nim')
-rw-r--r-- | src/utils/map.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/map.nim b/src/utils/map.nim index 4966fcb6..6472be06 100644 --- a/src/utils/map.nim +++ b/src/utils/map.nim @@ -1,13 +1,13 @@ import std/algorithm -func searchInMap*[U, T](a: openArray[(U, T)], u: U): int = - binarySearch(a, u, proc(x: (U, T), y: U): int = cmp(x[0], y)) +func searchInMap*[U, T](a: openArray[(U, T)]; u: U): int = + binarySearch(a, u, proc(x: (U, T); y: U): int = cmp(x[0], y)) -func isInMap*[U, T](a: openArray[(U, T)], u: U): bool = +func isInMap*[U, T](a: openArray[(U, T)]; u: U): bool = a.searchInMap(u) != -1 -func isInRange*[U](a: openArray[(U, U)], u: U): bool = - let res = binarySearch(a, u, proc(x: (U, U), y: U): int = +func isInRange*[U](a: openArray[(U, U)]; u: U): bool = + let res = binarySearch(a, u, proc(x: (U, U); y: U): int = if x[0] > y: 1 elif x[1] < y: |