`PickableState.values().singleOrNull { it.name == ...
# getting-started
j
PickableState.values().singleOrNull { it.name == state }
👍 3
m
this is good but do we really need to iterate over each value?
j
You may want to consider
firstOrNull
, this function returns the value when the predicate is met.
singleOrNull
iterates over every element in the list