Skip to content

Commit

Permalink
Update PatternPart.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
dlurton authored Sep 24, 2020
1 parent 158780d commit 85d494b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lang/src/org/partiql/lang/eval/like/PatternPart.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ private fun executeOnePart(partsItr: CheckpointIterator<PatternPart>, charsItr:

while (true) {
// Mark checkpoints on our iterators so that we can store the current position
// of them later if the if the remaining pattern parts don't match. We will keep
// of them later if the remaining pattern parts don't match. We will keep
// doing this and and advancing the current character position until the
// remaining pattern parts match. If we reach the end of the string, then there is no match.
partsItr.saveCheckpoint()
charsItr.saveCheckpoint()

if (executePattern(partsItr, charsItr)) {
// Discard the checkpoint saved above. We don't technically need to do this
// but it prevents the *next* pattern part from executing again.
// but it prevents the *next* pattern part from executing again without need.
partsItr.discardCheckpoint()
charsItr.discardCheckpoint()
return true
Expand Down

0 comments on commit 85d494b

Please sign in to comment.