Aller au contenu

Combine Collection Operations (ARCH8077)

Ce contenu n’est pas encore disponible dans votre langue.

Key kotlin.performance.combine-collection-operations · Severity info · Category performance

Flags filter { }.first() / filter { }.count() / filter { }.isNotEmpty() / map { }.filterNotNull() chains that have a single-pass equivalent.

users.filter { it.admin }.first()
users.first { it.admin }

Use first { }, count { }, any { }, mapNotNull { }.