This allows it being used in places where queries were only expected to be traversable and countable, but with the advantage of relying on the set's cache to avoid re-querying the results multiple times.
The caveat though, is that in any case (cached, or not) the set cannot provide the count unless traversed at least once. With the cache enabled, counting should establish the cache.
This allows it being used in places where queries were only expected to be traversable and countable, but with the advantage of relying on the set's cache to avoid re-querying the results multiple times.
The caveat though, is that in any case (cached, or not) the set cannot provide the count unless traversed at least once. With the cache enabled, counting should establish the cache.