Skip to content

Commit

Permalink
Remove unnecessary invoke calls
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Jul 16, 2023
1 parent 0b75618 commit 3ca05fd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ internal class LineOutputStream(private val consumer: (String) -> Unit) : Output
when (b[i]) {
LF -> {
if (!lastCR) {
consumer.invoke(buffer.toString(b, start, i))
consumer(buffer.toString(b, start, i))
}
start = i + 1
lastCR = false
}
CR -> {
consumer.invoke(buffer.toString(b, start, i))
consumer(buffer.toString(b, start, i))
start = i + 1
lastCR = true
}
Expand All @@ -51,7 +51,7 @@ internal class LineOutputStream(private val consumer: (String) -> Unit) : Output

override fun close() {
if (buffer.size > 0) {
consumer.invoke(buffer.toString())
consumer(buffer.toString())
}
}
}
Expand Down

0 comments on commit 3ca05fd

Please sign in to comment.