Dokcer code optimization

This commit is contained in:
bergware
2018-03-26 11:14:36 +02:00
parent aae15f0d3c
commit 8229bc8020
@@ -566,12 +566,6 @@ class DockerClient {
'500' => 'Server error'
];
private function buildSorter($key) {
return function ($a, $b) use ($key) {
return strnatcasecmp($a[$key], $b[$key]);
};
}
private function flushCache(&$cache) {
$cache = null;
}
@@ -739,7 +733,7 @@ class DockerClient {
}
$this::$containersCache[] = $c;
}
usort($this::$containersCache, $this->buildSorter('Name'));
array_multisort(array_column($this::$containersCache,'Name'), SORT_NATURAL|SORT_FLAG_CASE, $this::$containersCache);
return $this::$containersCache;
}