Use indices to lookup pieces for comparison
This commit is contained in:
parent
231301f5d7
commit
de2bea502c
@ -45,8 +45,8 @@ func equalFilterPieces(l, r []filterPiece) bool {
|
||||
|
||||
func sortFilterPieces(pieces []filterPiece, indices []int) {
|
||||
sort.Slice(indices, func(_i, _j int) bool {
|
||||
i := &pieces[_i]
|
||||
j := &pieces[_j]
|
||||
i := &pieces[indices[_i]]
|
||||
j := &pieces[indices[_j]]
|
||||
return multiless.New().Int(
|
||||
int(j.Priority), int(i.Priority),
|
||||
).Bool(
|
||||
|
Loading…
x
Reference in New Issue
Block a user