asSet

fun <E> Iterable<E>.asSet(): Set<E>(source)

shorthand for this as? Set<E> ?: toSet()

Return

itself if the receiver Iterable is already a Set<E>, otherwise calls toSet() to create a new one