mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 13:11:30 +00:00
Merge pull request #5794 from unclejack/speed_up_ps
don't call sort for every add in daemon/history
This commit is contained in:
@@ -85,6 +85,7 @@ func (daemon *Daemon) List() []*Container {
|
||||
for e := daemon.containers.Front(); e != nil; e = e.Next() {
|
||||
containers.Add(e.Value.(*Container))
|
||||
}
|
||||
containers.Sort()
|
||||
return *containers
|
||||
}
|
||||
|
||||
|
||||
@@ -26,5 +26,8 @@ func (history *History) Swap(i, j int) {
|
||||
|
||||
func (history *History) Add(container *Container) {
|
||||
*history = append(*history, container)
|
||||
}
|
||||
|
||||
func (history *History) Sort() {
|
||||
sort.Sort(history)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user