From e2f53ee107862d7c5b7dca6df3e68add74273336 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 11 Dec 2021 12:02:23 +0000 Subject: Fix #1362 `strings.index_any` --- core/strings/strings.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/strings') diff --git a/core/strings/strings.odin b/core/strings/strings.odin index a8199e0cf..7a9744d83 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -504,8 +504,8 @@ index_any :: proc(s, chars: string) -> int { } } - for c in chars { - if i := index_rune(s, c); i >= 0 { + for c in s { + if i := index_rune(chars, c); i >= 0 { return i } } -- cgit v1.2.3 From 85f8c8df91022fae3fef996cd45b9e631e6b2a66 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 11 Dec 2021 12:04:34 +0000 Subject: Fix `fields_proc` in `strings` and `bytes` --- core/bytes/bytes.odin | 2 +- core/strings/strings.odin | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'core/strings') diff --git a/core/bytes/bytes.odin b/core/bytes/bytes.odin index cbc1e2506..1e83b93c8 100644 --- a/core/bytes/bytes.odin +++ b/core/bytes/bytes.odin @@ -1143,7 +1143,7 @@ fields_proc :: proc(s: []byte, f: proc(rune) -> bool, allocator := context.alloc } if start >= 0 { - append(&subslices, s[start : end]) + append(&subslices, s[start : len(s)]) } return subslices[:] diff --git a/core/strings/strings.odin b/core/strings/strings.odin index 7a9744d83..72f29e5d6 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -1288,7 +1288,7 @@ fields_proc :: proc(s: string, f: proc(rune) -> bool, allocator := context.alloc } if start >= 0 { - append(&substrings, s[start : end]) + append(&substrings, s[start : len(s)]) } return substrings[:] -- cgit v1.2.3 From 4423bc0706a6a1a64cf419720fd65bc723fdf58a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 12 Dec 2021 01:10:40 +0000 Subject: Fix typo --- core/strings/strings.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/strings') diff --git a/core/strings/strings.odin b/core/strings/strings.odin index 72f29e5d6..3f703372f 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -504,8 +504,8 @@ index_any :: proc(s, chars: string) -> int { } } - for c in s { - if i := index_rune(chars, c); i >= 0 { + for c, i in s { + if index_rune(chars, c) >= 0 { return i } } -- cgit v1.2.3