Skip to content

Commit

Permalink
remotecache: other fix to record sorting
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Gordon <[email protected]>
  • Loading branch information
msg555 committed Aug 8, 2019
1 parent f5a55a9 commit 3c3dac0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cache/remotecache/v1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ func sortConfig(cc *CacheConfig) {
if ri.Inputs[i][j].Selector != rj.Inputs[i][j].Selector {
return ri.Inputs[i][j].Selector < rj.Inputs[i][j].Selector
}
return cc.Records[ri.Inputs[i][j].LinkIndex].Digest < cc.Records[rj.Inputs[i][j].LinkIndex].Digest
inputDigesti := cc.Records[ri.Inputs[i][j].LinkIndex].Digest
inputDigestj := cc.Records[rj.Inputs[i][j].LinkIndex].Digest
if inputDigesti != inputDigestj {
return inputDigesti < inputDigestj
}
}
}
return ri.Digest < rj.Digest
return false
})
for i, l := range sortedRecords {
l.newIndex = i
Expand Down

0 comments on commit 3c3dac0

Please sign in to comment.