Re: improvements to fn:sort functions

> 
> From simply a theoretical point of view (and particularly, when the sequence to be sorted is quite large), I think that doing fn:reverse after doing fn:sort would certainly be more time consuming (than fn:sort flagged with 'descending').
>  
> [1] https://www.w3.org/TR/xpath-30/#id-arithmetic <https://www.w3.org/TR/xpath-30/#id-arithmetic>
> 

That depends entirely on implementation. There are possible implementations of lists where fn:reverse() just involves flipping one bit.

Michael Kay
Saxonica

Received on Saturday, 16 January 2021 11:50:24 UTC