Note about all() result on empty collections KT-54835
This commit is contained in:
committed by
Space Team
parent
77e03bb769
commit
0d0cc9250b
@@ -157,6 +157,10 @@ public inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.mapTo(des
|
||||
/**
|
||||
* Returns `true` if all entries match the given [predicate].
|
||||
*
|
||||
* Note that if the map contains no entries, the function returns `true`
|
||||
* because there are no entries 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 <K, V> Map<out K, V>.all(predicate: (Map.Entry<K, V>) -> Boolean): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user