TIL

아이템 50 컬렉션 처리 단계 수를 제한하라

// 작동은 한다.
fun List<Student>.getNames(): List<String> = 
	this.map { it.name }
		.filter { it != null }
		.map { it!! }

// 더 좋다.
fun List<Student>.getNames(): List<String> = 
	this.map { it.name }
		.filterNotNull()

fun List<Student>.getNames(): List<String> = 
	this.mapNotNull { it.name }