about summary refs log tree commit diff stats
path: root/src/utils
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-07-28 00:04:12 +0200
committerbptato <nincsnevem662@gmail.com>2023-07-28 00:04:12 +0200
commitec37eee0d637cc36347cc1e6093c0027f80bdcc1 (patch)
treebfe29b77f76fc2ad28a7c0c930a6b9bba19cf9af /src/utils
parent7c5d2e7557064ab86b9ef525cc7b9499c135e53f (diff)
downloadchawan-ec37eee0d637cc36347cc1e6093c0027f80bdcc1.tar.gz
Fix twtstr.cmp
We were comparing the wrong sides of ranges here.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/twtstr.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim
index df67b8f3..9273b703 100644
--- a/src/utils/twtstr.nim
+++ b/src/utils/twtstr.nim
@@ -927,9 +927,9 @@ const Combining = [
 ]
 
 func cmp(range: (uint32, uint32), r: Rune): int =
-  if range[0] < cast[uint32](r):
+  if range[1] < cast[uint32](r):
     return -1
-  elif range[1] > cast[uint32](r):
+  elif range[0] > cast[uint32](r):
     return 1
   return 0