4 ms·
> you have got all the results in memory anyways inside the xpath function Not necessarily, that's an implementation detail. The result of an XPath query is no
by gridlockd 6y ago
> you have got all the results in memory anyways inside the xpath function
Not necessarily, that's an implementation detail. The result of an XPath query is not an array, it's some object that accepts integer indices for lookup.
If you were to return an array, there would be no way to break out of iteration early without paying for every lookup. For something like XPath, breaking out early is a likely scenario.