Take caution when advancing to the next match after an empty string was matched not to stuck at the same position.

This commit is contained in:
Ilya Gorbunov
2015-04-23 18:04:50 +03:00
parent 260553d516
commit aa6bdb039b
3 changed files with 4 additions and 4 deletions
@@ -244,7 +244,7 @@ private fun Matcher.findNext(from: Int): MatchResult? {
}
override fun next(): MatchResult? = this@findNext.findNext(matchResult.end())
override fun next(): MatchResult? = this@findNext.findNext(matchResult.end() + if (matchResult.end() == matchResult.start()) 1 else 0)
}
}