| 1 | package binpatch |
| 2 | |
| 3 | type sorter struct { |
| 4 | p *PatchSet |
| 5 | } |
| 6 | |
| 7 | func (s sorter) Len() int { |
| 8 | return len(s.p.Patches) |
| 9 | } |
| 10 | |
| 11 | func (s sorter) Less(i, j int) bool { |
| 12 | return s.p.Patches[i].Offset < s.p.Patches[j].Offset |
| 13 | } |
| 14 | |
| 15 | func (s sorter) Swap(i, j int) { |
| 16 | s.p.Patches[i], s.p.Patches[j] = s.p.Patches[j], s.p.Patches[i] |
| 17 | s.p.Blobs[i], s.p.Blobs[j] = s.p.Blobs[j], s.p.Blobs[i] |
| 18 | } |