History.Swap Use parallel assignment to swap elements, as it's
a more idiomatic way for golang than using a temp variable. Signed-off-by: Anton Tiurin <noxiouz@yandex.ru> Upstream-commit: fc325274e84a0c16b758e3d6b121c9af1150cce2 Component: engine
This commit is contained in:
@@ -19,9 +19,7 @@ func (history *History) Less(i, j int) bool {
|
||||
|
||||
func (history *History) Swap(i, j int) {
|
||||
containers := *history
|
||||
tmp := containers[i]
|
||||
containers[i] = containers[j]
|
||||
containers[j] = tmp
|
||||
containers[i], containers[j] = containers[j], containers[i]
|
||||
}
|
||||
|
||||
func (history *History) Add(container *Container) {
|
||||
|
||||
Reference in New Issue
Block a user