mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Make filtering a linear operation.
Improves the current filtering implementation complixity. Currently, the best case is O(N) and worst case O(N^2) for key-value filtering. In the new implementation, the best case is O(1) and worst case O(N), again for key-value filtering. Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
parent
8a350c5c7b
commit
93d1dd8036
13 changed files with 444 additions and 238 deletions
|
@ -230,9 +230,9 @@ func isNetworkAvailable(c *check.C, name string) bool {
|
|||
func getNetworkIDByName(c *check.C, name string) string {
|
||||
var (
|
||||
v = url.Values{}
|
||||
filterArgs = filters.Args{}
|
||||
filterArgs = filters.NewArgs()
|
||||
)
|
||||
filterArgs["name"] = []string{name}
|
||||
filterArgs.Add("name", name)
|
||||
filterJSON, err := filters.ToParam(filterArgs)
|
||||
c.Assert(err, checker.IsNil)
|
||||
v.Set("filters", filterJSON)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue