aboutsummaryrefslogtreecommitdiff
path: root/core/bytes/bytes.odin
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-09-27 22:31:46 +0100
committergingerBill <bill@gingerbill.org>2022-09-27 22:31:46 +0100
commitc4d19dfa925ffe44c04fcda90543a272b7165274 (patch)
treec493697ab16154885febf04511f7f61e64b4bbbb /core/bytes/bytes.odin
parent35e70f4be17f4123ec25108d664864f13b38087e (diff)
Use `uint` instead of `int` to improve code generation for bounds checking
Diffstat (limited to 'core/bytes/bytes.odin')
-rw-r--r--core/bytes/bytes.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/bytes/bytes.odin b/core/bytes/bytes.odin
index f1737f3c5..d39f01b06 100644
--- a/core/bytes/bytes.odin
+++ b/core/bytes/bytes.odin
@@ -638,7 +638,7 @@ trim_left_proc :: proc(s: []byte, p: proc(rune) -> bool) -> []byte {
index_rune :: proc(s: []byte, r: rune) -> int {
switch {
- case 0 <= r && r < utf8.RUNE_SELF:
+ case u32(r) < utf8.RUNE_SELF:
return index_byte(s, byte(r))
case r == utf8.RUNE_ERROR: