What tould be a good kotlin way to perform multipl...
# getting-started
d
What tould be a good kotlin way to perform multiple (but same) comparisons with a object?
fun isNewTarget(touched: Draft) = touched !== sourceTouched && touched !== targetTouched
might it be possible to simplify this?
d
ferranis: You could do
touched !in setOf(sourceTouched, targetTouched)
, but that has some overhead obviously. Not sure if you can do much better than your version.
👍 1
d
Thank you anyway! Maybe we get more ideas on this from the rest of the channel
a
You could use something like: listOf(sourceTouched, targetTouched).none{ it == touched }