From face00e2a78d0035c21c31d64583709861db2103 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 18 May 2020 23:32:36 +0200 Subject: [PATCH] Sped up parsing job TAN configurations a bit --- .../banking/fints/response/ResponseParser.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fints4k/src/main/kotlin/net/dankito/banking/fints/response/ResponseParser.kt b/fints4k/src/main/kotlin/net/dankito/banking/fints/response/ResponseParser.kt index 1b0d40df..225dd289 100644 --- a/fints4k/src/main/kotlin/net/dankito/banking/fints/response/ResponseParser.kt +++ b/fints4k/src/main/kotlin/net/dankito/banking/fints/response/ResponseParser.kt @@ -338,12 +338,18 @@ open class ResponseParser @JvmOverloads constructor( } protected open fun parseJobTanConfigurations(dataElementGroups: List): List { - return dataElementGroups.chunked(2).map { - JobTanConfiguration( - parseString(it[0]), - parseBoolean(it[1]) + val jobTanConfigurations = mutableListOf() + + for (i in dataElementGroups.indices step 2) { + jobTanConfigurations.add( + JobTanConfiguration( + parseString(dataElementGroups[i]), + parseBoolean(dataElementGroups[i + 1]) + ) ) } + + return jobTanConfigurations }