asList

fun <E> Iterable<E>.asList(): List<E>(source)

shorthand for this as? List<E> ?: toList()

Return

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