mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
Fix typos
This commit is contained in:
@@ -2,6 +2,7 @@ package strings
|
|||||||
|
|
||||||
import "core:io"
|
import "core:io"
|
||||||
import "core:mem"
|
import "core:mem"
|
||||||
|
import "core:unicode"
|
||||||
import "core:unicode/utf8"
|
import "core:unicode/utf8"
|
||||||
|
|
||||||
clone :: proc(s: string, allocator := context.allocator, loc := #caller_location) -> string {
|
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 {
|
fields_proc :: proc(s: string, f: proc(rune) -> bool, allocator := context.allocator) -> []string #no_bounds_check {
|
||||||
substrings := make([dynamic]string, 0, 32, allocator);
|
substrings := make([dynamic]string, 0, 32, allocator);
|
||||||
|
|
||||||
start := -1;
|
start, end := -1, -1;
|
||||||
|
for r, offset in s {
|
||||||
for end, r in s {
|
end = offset;
|
||||||
if f(r) {
|
if f(r) {
|
||||||
if start >= 0 {
|
if start >= 0 {
|
||||||
append(&substrings, s[start : end]);
|
append(&substrings, s[start : end]);
|
||||||
|
|||||||
Reference in New Issue
Block a user