about summary refs log tree commit diff stats
path: root/src/utils/map.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-12-16 18:30:03 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-16 18:30:03 +0100
commita3b2d9189f3b25c7cf79985beac843cc46c37cfc (patch)
tree7b371adff64309f98edcf8115eba6461a9c3bce0 /src/utils/map.nim
parent3f2bc1069142ae13f9991102a0c01cd1291b08e8 (diff)
downloadchawan-a3b2d9189f3b25c7cf79985beac843cc46c37cfc.tar.gz
strwidth & url fixes
* actually search Combining for isCombining
* fix searchInMap
* fix cmpRange of url
Diffstat (limited to 'src/utils/map.nim')
-rw-r--r--src/utils/map.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/map.nim b/src/utils/map.nim
index 2a3515a1..620dec58 100644
--- a/src/utils/map.nim
+++ b/src/utils/map.nim
@@ -11,10 +11,10 @@ func isInMap*[U, T](a: openArray[(U, T)], u: U): bool =
 
 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:
+    if x[0] > y:
       1
+    elif x[1] < y:
+      -1
     else:
       0
   )