aboutsummaryrefslogtreecommitdiff
path: root/core/strconv.odin
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-04-22 09:40:32 +0100
committerGinger Bill <bill@gingerbill.org>2017-04-22 09:40:32 +0100
commit0ea815db498d52ffd654801cc68bb95f4fdb437e (patch)
tree913cbb2e27b89e9322ac172bcd1e1dbdca6350f4 /core/strconv.odin
parent91ed51ff5c9c49a739f6a835acf6df492690e2cd (diff)
Fix constant bounds checking for slicing
Diffstat (limited to 'core/strconv.odin')
-rw-r--r--core/strconv.odin8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/strconv.odin b/core/strconv.odin
index 21a466871..853134499 100644
--- a/core/strconv.odin
+++ b/core/strconv.odin
@@ -21,12 +21,12 @@ parse_bool :: proc(s: string) -> (result: bool, ok: bool) {
_digit_value :: proc(r: rune) -> (int) {
ri := cast(int)r;
v: int = 16;
- match {
- case '0' <= r && r <= '9':
+ match r {
+ case '0'..'9':
v = ri - '0';
- case 'a' <= r && r <= 'z':
+ case 'a'..'z':
v = ri - 'a' + 10;
- case 'A' <= r && r <= 'Z':
+ case 'A'..'Z':
v = ri - 'A' + 10;
}
return v;