1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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>
This commit is contained in:
Anton Tiurin 2015-03-25 00:11:04 +03:00
parent 46321a1e4f
commit fc325274e8

View file

@ -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) {