count method
Returns the number of entries matching the given predicate
or the number of entries when predicate = null
.
Implementation
int count([bool Function(KtMapEntry<K, V>)? predicate]) {
if (predicate == null) {
return size;
}
var count = 0;
final KtIterator<KtMapEntry<K, V>> i = iterator();
while (i.hasNext()) {
if (predicate(i.next())) {
count++;
}
}
return count;
}