-
Improvement
-
Resolution: Unresolved
-
Medium
-
None
-
None
LazyDOMQueryResult is an Iterable and is using the default IteratorSpliterator. Since we expeect to be used mostly with streams, prefer to add DOMQuerySpliterator and build the DOMQueryIterator as a very simple shim.
This should bias us more towards streaming cases, as we end up allocating fewer objects for streams. It also allows us to communicate important properties, i.e. distinct, nullable, immutable.
The cost for iteration users would be allocation of another two objects (backing spliterator and a lambda), but that is fine.
Remember that things like forEachRemaining() can be forwarded as well.