mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #2678 from cxmcc/minor
Minor code simplification for Containers api
This commit is contained in:
commit
d6e6214d37
1 changed files with 2 additions and 5 deletions
|
@ -697,15 +697,12 @@ func (srv *Server) Containers(all, size bool, n int, since, before string) []API
|
||||||
if !container.State.Running && !all && n == -1 && since == "" && before == "" {
|
if !container.State.Running && !all && n == -1 && since == "" && before == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if before != "" {
|
if before != "" && !foundBefore {
|
||||||
if container.ID == before || utils.TruncateID(container.ID) == before {
|
if container.ID == before || utils.TruncateID(container.ID) == before {
|
||||||
foundBefore = true
|
foundBefore = true
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
if !foundBefore {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if displayed == n {
|
if displayed == n {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue