diff --git a/module-server/src/main/kotlin/de/twomartens/wahlrecht/service/CalculationService.kt b/module-server/src/main/kotlin/de/twomartens/wahlrecht/service/CalculationService.kt index 06a8d1c..9723959 100644 --- a/module-server/src/main/kotlin/de/twomartens/wahlrecht/service/CalculationService.kt +++ b/module-server/src/main/kotlin/de/twomartens/wahlrecht/service/CalculationService.kt @@ -5,7 +5,6 @@ import mu.KotlinLogging import org.springframework.lang.NonNull import org.springframework.stereotype.Service import org.springframework.util.StopWatch -import java.util.* import kotlin.math.roundToInt @Service @@ -13,7 +12,7 @@ class CalculationService( private val nominationService: NominationService, private val electionService: ElectionService ) { - private val electionNumberHistory = LinkedList() + private val electionNumberHistory: MutableList = mutableListOf() fun determineElectedCandidates(electionResult: ElectionResult): ElectedCandidates { log.info("Calculate election result for election {}", electionResult.electionName) @@ -34,7 +33,7 @@ class CalculationService( } val electedCandidatesMap = constituencyResults.entries.asSequence() .flatMap { it.value.electedCandidates.entries.asSequence() } - .groupingBy(keySelector = { it.key.nominationId.partyAbbreviation }) + .groupingBy { it.key.nominationId.partyAbbreviation } .fold(listOf()) { accumulator, element -> accumulator + element.value } val remainingSeatsPerParty = seatResult.seatsPerResult.entries.asSequence() .map {