Skip to content

Commit

Permalink
batch trimming refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
lumber1000 committed Nov 15, 2024
1 parent 8b6d7d5 commit 0bdd05b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ class MessageExtractor<B, G, RM, PM>(
}
}

val trimmedMessages = if (endIndex - startIndex == orderedMessages.size) {
orderedMessages
} else {
orderedMessages.subList(startIndex, endIndex)
val trimmedMessages = when (endIndex - startIndex) {
0 -> emptyList()
orderedMessages.size -> orderedMessages
else -> orderedMessages.subList(startIndex, endIndex)
}

LOGGER.trace {
Expand Down

0 comments on commit 0bdd05b

Please sign in to comment.