Sped up parsing job TAN configurations a bit

This commit is contained in:
dankito 2020-05-18 23:32:36 +02:00
parent bd77a8b6f4
commit face00e2a7
1 changed files with 10 additions and 4 deletions

View File

@ -338,12 +338,18 @@ open class ResponseParser @JvmOverloads constructor(
} }
protected open fun parseJobTanConfigurations(dataElementGroups: List<String>): List<JobTanConfiguration> { protected open fun parseJobTanConfigurations(dataElementGroups: List<String>): List<JobTanConfiguration> {
return dataElementGroups.chunked(2).map { val jobTanConfigurations = mutableListOf<JobTanConfiguration>()
for (i in dataElementGroups.indices step 2) {
jobTanConfigurations.add(
JobTanConfiguration( JobTanConfiguration(
parseString(it[0]), parseString(dataElementGroups[i]),
parseBoolean(it[1]) parseBoolean(dataElementGroups[i + 1])
)
) )
} }
return jobTanConfigurations
} }