From 0bdd05b4032c7e7149db6a4601e922ceeed6355b Mon Sep 17 00:00:00 2001 From: lumber1000 <45400511+lumber1000@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:59:05 +0400 Subject: [PATCH] batch trimming refactored --- .../rptdataprovider/handlers/messages/MessageExtractor.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/exactpro/th2/rptdataprovider/handlers/messages/MessageExtractor.kt b/src/main/kotlin/com/exactpro/th2/rptdataprovider/handlers/messages/MessageExtractor.kt index e9a56507..08da9fe9 100644 --- a/src/main/kotlin/com/exactpro/th2/rptdataprovider/handlers/messages/MessageExtractor.kt +++ b/src/main/kotlin/com/exactpro/th2/rptdataprovider/handlers/messages/MessageExtractor.kt @@ -192,10 +192,10 @@ class MessageExtractor( } } - 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 {