From f0be9c4403c2094a7698bb6fbfb3f932c5ff69e8 Mon Sep 17 00:00:00 2001 From: Anton Tiurin Date: Wed, 25 Mar 2015 00:11:04 +0300 Subject: [PATCH] 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 Upstream-commit: fc325274e84a0c16b758e3d6b121c9af1150cce2 Component: engine --- components/engine/daemon/history.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/engine/daemon/history.go b/components/engine/daemon/history.go index 0b125ad2b3..f717508726 100644 --- a/components/engine/daemon/history.go +++ b/components/engine/daemon/history.go @@ -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) {