diff --git a/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/slo/SloFactory.kt b/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/slo/SloFactory.kt index 047f8a657de8aba6f032d36e8b84d7046d5e0209..ef67348c0c848226b5b4127a34880fcd5a6bc1e9 100644 --- a/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/slo/SloFactory.kt +++ b/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/slo/SloFactory.kt @@ -7,18 +7,15 @@ import rocks.theodolite.kubernetes.model.KubernetesBenchmark.Slo class SloFactory { fun createSlos(execution: BenchmarkExecution, benchmark: KubernetesBenchmark): List<Slo> { - var benchmarkSlos = benchmark.slos - var executionSlos = execution.slos + val resultSlos = benchmark.slos.toMutableList() - for(executionSlo in executionSlos) { - for(i in 0 until benchmarkSlos.size) { - if(executionSlo.name == benchmarkSlos[i].name && executionSlo.properties != null) { - for (executionProperty in executionSlo.properties!!) { - benchmarkSlos[i].properties[executionProperty.key] = executionProperty.value - } + for (executionSlo in execution.slos) { + for (resultSlo in resultSlos) { + if (executionSlo.name == resultSlo.name && executionSlo.properties != null) { + resultSlo.properties.putAll(executionSlo.properties!!) } } } - return benchmarkSlos + return resultSlos } } \ No newline at end of file