Merge pull request #3006 from hwchen/hwchen/last_index_any

fix strings.last_index_any for single char
This commit is contained in:
Jeroen van Rijn
2024-01-08 15:57:36 +01:00
committed by GitHub
2 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -1792,7 +1792,8 @@ last_index_any :: proc(s, chars: string) -> (res: int) {
if r >= utf8.RUNE_SELF {
r = utf8.RUNE_ERROR
}
return index_rune(chars, r)
i := index_rune(chars, r)
return i if i < 0 else 0
}
if len(s) > 8 {