diff options
| author | gingerBill <bill@gingerbill.org> | 2018-12-31 15:50:49 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-12-31 15:50:49 +0000 |
| commit | 1c9656aedb3040b7f08161ece138ce0fe33c4699 (patch) | |
| tree | 8b45edc4be9f0ecf6a8f67370f2cf531785ca9fb /core/strings | |
| parent | 8b2f902f3debfbf16f8be8e80388462587095766 (diff) | |
Vet core library
Diffstat (limited to 'core/strings')
| -rw-r--r-- | core/strings/strings.odin | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/strings/strings.odin b/core/strings/strings.odin index 9d9082b62..9f8d20d5b 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -283,8 +283,8 @@ replace :: proc(s, old, new: string, n: int, allocator := context.allocator) -> j := start; if len(old) == 0 { if i > 0 { - _, w := utf8.decode_rune_in_string(s[start:]); - j += w; + _, width := utf8.decode_rune_in_string(s[start:]); + j += width; } } else { j += index(s[start:], old); @@ -381,8 +381,8 @@ index_rune :: proc(s: string, r: rune) -> int { return index_byte(s, byte(r)); case r == utf8.RUNE_ERROR: - for r, i in s { - if r == utf8.RUNE_ERROR { + for c, i in s { + if c == utf8.RUNE_ERROR { return i; } } |