diff options
| author | gingerBill <bill@gingerbill.org> | 2021-08-01 23:56:17 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-08-01 23:56:17 +0100 |
| commit | be76da2c90824f3671328957e8d513bba605c086 (patch) | |
| tree | 1b16bc4b4836c094c55356c4efc23aef84a43c77 /src/string.cpp | |
| parent | b1a8357f509d0dfa2d496746831dfb1008ab94a7 (diff) | |
Begin optimizing tokenizer; Replace `gb_utf8_decode` with `utf8_decode` (CC but easier to change later)
Diffstat (limited to 'src/string.cpp')
| -rw-r--r-- | src/string.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/string.cpp b/src/string.cpp index 4e8273f60..0764009bc 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -500,7 +500,7 @@ String quote_to_ascii(gbAllocator a, String str, u8 quote='"') { Rune r = cast(Rune)s[0]; width = 1; if (r >= 0x80) { - width = gb_utf8_decode(s, n, &r); + width = utf8_decode(s, n, &r); } if (width == 1 && r == GB_RUNE_INVALID) { array_add(&buf, cast(u8)'\\'); @@ -576,7 +576,7 @@ bool unquote_char(String s, u8 quote, Rune *rune, bool *multiple_bytes, String * return false; } else if (s[0] >= 0x80) { Rune r = -1; - isize size = gb_utf8_decode(s.text, s.len, &r); + isize size = utf8_decode(s.text, s.len, &r); *rune = r; *multiple_bytes = true; *tail_string = make_string(s.text+size, s.len-size); @@ -736,7 +736,7 @@ i32 unquote_string(gbAllocator a, String *s_, u8 quote=0, bool has_carriage_retu return 1; } else if (quote == '\'') { Rune r = GB_RUNE_INVALID; - isize size = gb_utf8_decode(s.text, s.len, &r); + isize size = utf8_decode(s.text, s.len, &r); if ((size == s.len) && (r != -1 || size != 1)) { *s_ = s; return 1; |