Browse Source

Fix `fields_proc` in `strings` and `bytes`

gingerBill 3 years ago
parent
commit
85f8c8df91
2 changed files with 2 additions and 2 deletions
  1. 1 1
      core/bytes/bytes.odin
  2. 1 1
      core/strings/strings.odin

+ 1 - 1
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[:]

+ 1 - 1
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[:]