all: replace sort.Sort and sort.Slice with slices.SortFunc
In the case of sort.Sort, we avoid having to implement three methods.
In both cases, we compare via ints (-1, 0, -1) rather than a less bool,
meaning that we don't need a separate "equal" check logic
and we also need to make fewer comparisons as part of the sorting.
The code is less verbose too, as we don't need to index into the slice.
While here, fix a couple of broken links I spotted along the way.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ib687da2cc357ea784a51f3a832cf3265376fbef0
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1189331
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>