BugFix for short lists
This commit is contained in:
@@ -49,6 +49,7 @@ fun String.nthIndexOf(
|
||||
while (occur > 0) {
|
||||
// calling the native function multiple times is faster than looping just once
|
||||
pos = indexOf(ch, pos + 1)
|
||||
if (pos == -1) return -1
|
||||
occur--
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user