mirror of
https://github.com/rekryt/iplist.git
synced 2026-02-26 09:18:35 +03:00
fix: optimize AbstractIPListController - method getSites()
This commit is contained in:
@@ -18,12 +18,13 @@ class AmneziaController extends AbstractIPListController {
|
||||
}
|
||||
|
||||
$response = [];
|
||||
$sitesEntities = $this->getSites();
|
||||
if (count($sites)) {
|
||||
foreach ($sites as $site) {
|
||||
$response = array_merge($response, $this->getSites()[$site]->$data);
|
||||
$response = array_merge($response, $sitesEntities[$site]->$data ?? []);
|
||||
}
|
||||
} else {
|
||||
foreach ($this->getSites() as $siteEntity) {
|
||||
foreach ($sitesEntities as $siteEntity) {
|
||||
$response = array_merge($response, $siteEntity->$data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user