diff options
| author | gingerBill <bill@gingerbill.org> | 2020-12-04 18:53:17 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-12-04 18:53:17 +0000 |
| commit | edbb3e3b32c2d42f04655f2ef9d03b365c8a0cfe (patch) | |
| tree | ac5497d9ab7ed471d2ead7095d4313f412e7a1a4 /core/strings/strings.odin | |
| parent | ecf324e2138c7e950f283ed18b11954858c8c0a9 (diff) | |
Fix typos
Diffstat (limited to 'core/strings/strings.odin')
| -rw-r--r-- | core/strings/strings.odin | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/strings/strings.odin b/core/strings/strings.odin index 7bb6c33fc..09c39050f 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -2,6 +2,7 @@ package strings import "core:io" import "core:mem" +import "core:unicode" import "core:unicode/utf8" clone :: proc(s: string, allocator := context.allocator, loc := #caller_location) -> string { @@ -1014,9 +1015,9 @@ fields :: proc(s: string, allocator := context.allocator) -> []string #no_bounds fields_proc :: proc(s: string, f: proc(rune) -> bool, allocator := context.allocator) -> []string #no_bounds_check { substrings := make([dynamic]string, 0, 32, allocator); - start := -1; - - for end, r in s { + start, end := -1, -1; + for r, offset in s { + end = offset; if f(r) { if start >= 0 { append(&substrings, s[start : end]); |