Skip to content

Commit

Permalink
Make ConcatIterator.check() tail recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Dec 30, 2023
1 parent e843be0 commit 787c954
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/kotlin/io/exoquery/pprint/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ object Util {
private var head: Iterator<T>? = null
private var count = 0

// tailrec
private fun check(): Boolean =
private tailrec fun check(): Boolean =
if (head != null && head?.hasNext()!!) true
else if (!it0.hasNext()) false
else {
Expand Down

0 comments on commit 787c954

Please sign in to comment.