Skip to content

Commit

Permalink
reduce code complexity
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo <[email protected]>
  • Loading branch information
Balcan committed Oct 30, 2024
1 parent e20d7b0 commit c9d5ba9
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ interface RuleVariable {
): RuleVariableValue

fun getOptionName(value: String): String {
// if no option found then existing value in the context will be used
return options
.filter { (_, code): Option -> value == code }
.map(Option::name)
.getOrElse(0) { _ -> value }
.find { (_, code): Option -> value == code }?.name ?: value
}
}

0 comments on commit c9d5ba9

Please sign in to comment.