XPath: Optimize insertion_sort
XPath: Optimize insertion_sort

The previous implementation opted for doing two comparisons per element
in the sorted case in order to remove one iterator bounds check per
moved element when we actually need to copy. In our case however the
comparator is pretty expensive (except for remove_duplicates which is
fast as it is) so an extra object comparison hurts much more than an
iterator comparison saves.

This makes sorting by document order up to 3% faster for random
sequences.

zeux/pugixml,zeux/pugixml,zeux/pugixml,zeux/pugixml