Skip to content

Commit

Permalink
fix: do not run getProcessors multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed Apr 23, 2024
1 parent 6f60790 commit da2f8a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/main/kotlin/runner/Parser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ class Parser(file: File) {
return processors
}

fun getStages(): List<Stage> {
val processors = getProcessors()
fun getStages(processors: List<Processor>): List<Stage> {
return listOf(Stage(processors[0], listOf("JVM Runner")))
}
}
2 changes: 1 addition & 1 deletion src/main/kotlin/runner/Pipeline.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Pipeline(config: File) {
val processors = parser.getProcessors()

this.processors.putAll(processors.map { it.name to it })
this.stages = parser.getStages()
this.stages = parser.getStages(processors)
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/util/Reflect.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class Reflect {
}.toTypedArray()

logger.info(
"Retrieving method $name with arguments ${args.joinToString()}",
"Retrieving method $name with arguments [${args.joinToString(
", ",
)}]",
)

return try {
Expand Down

0 comments on commit da2f8a8

Please sign in to comment.