diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-04-22 09:40:32 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-04-22 09:40:32 +0100 |
| commit | 0ea815db498d52ffd654801cc68bb95f4fdb437e (patch) | |
| tree | 913cbb2e27b89e9322ac172bcd1e1dbdca6350f4 /core/strconv.odin | |
| parent | 91ed51ff5c9c49a739f6a835acf6df492690e2cd (diff) | |
Fix constant bounds checking for slicing
Diffstat (limited to 'core/strconv.odin')
| -rw-r--r-- | core/strconv.odin | 8 |
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; |