Note about all() result on empty collections KT-54835

This commit is contained in:
Ilya Gorbunov
2022-11-24 21:48:57 +01:00
committed by Space Team
parent 77e03bb769
commit 0d0cc9250b
7 changed files with 73 additions and 1 deletions
@@ -1054,6 +1054,10 @@ public fun CharSequence.withIndex(): Iterable<IndexedValue<Char>> {
/**
* Returns `true` if all characters match the given [predicate].
*
* Note that if the char sequence contains no characters, the function returns `true`
* because there are no characters in it that _do not_ match the predicate.
* See a more detailed explanation of this logic concept in ["Vacuous truth"](https://en.wikipedia.org/wiki/Vacuous_truth) article.
*
* @sample samples.collections.Collections.Aggregates.all
*/
public inline fun CharSequence.all(predicate: (Char) -> Boolean): Boolean {