mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 12:18:15 +00:00
Small optimization
This commit is contained in:
@@ -1031,7 +1031,7 @@ Returns:
|
|||||||
*/
|
*/
|
||||||
@private
|
@private
|
||||||
_split_iterator :: proc(s: ^string, sep: string, sep_save: int) -> (res: string, ok: bool) {
|
_split_iterator :: proc(s: ^string, sep: string, sep_save: int) -> (res: string, ok: bool) {
|
||||||
m := index(s^, sep)
|
m: int
|
||||||
if sep == "" {
|
if sep == "" {
|
||||||
if len(s) == 0 {
|
if len(s) == 0 {
|
||||||
m = -1
|
m = -1
|
||||||
@@ -1039,6 +1039,8 @@ _split_iterator :: proc(s: ^string, sep: string, sep_save: int) -> (res: string,
|
|||||||
_, w := utf8.decode_rune_in_string(s^)
|
_, w := utf8.decode_rune_in_string(s^)
|
||||||
m = w
|
m = w
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
m = index(s^, sep)
|
||||||
}
|
}
|
||||||
if m < 0 {
|
if m < 0 {
|
||||||
// not found
|
// not found
|
||||||
|
|||||||
Reference in New Issue
Block a user