mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
perf(mounts): avoid array_merge in mounts loop
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
This commit is contained in:
parent
b3200be621
commit
855152110f
1 changed files with 4 additions and 4 deletions
|
|
@ -62,7 +62,7 @@ class MountProvider implements IMountProvider {
|
|||
|
||||
$superShares = $this->buildSuperShares($shares, $user);
|
||||
|
||||
$otherMounts = $this->mountManager->getAll();
|
||||
$allMounts = $this->mountManager->getAll();
|
||||
$mounts = [];
|
||||
$view = new View('/' . $user->getUID() . '/files');
|
||||
$ownerViews = [];
|
||||
|
|
@ -93,7 +93,7 @@ class MountProvider implements IMountProvider {
|
|||
$shareId = (int)$parentShare->getId();
|
||||
$mount = new SharedMount(
|
||||
'\OCA\Files_Sharing\SharedStorage',
|
||||
array_merge($mounts, $otherMounts),
|
||||
$allMounts,
|
||||
[
|
||||
'user' => $user->getUID(),
|
||||
// parent share
|
||||
|
|
@ -116,9 +116,9 @@ class MountProvider implements IMountProvider {
|
|||
$event = new ShareMountedEvent($mount);
|
||||
$this->eventDispatcher->dispatchTyped($event);
|
||||
|
||||
$mounts[$mount->getMountPoint()] = $mount;
|
||||
$mounts[$mount->getMountPoint()] = $allMounts[$mount->getMountPoint()] = $mount;
|
||||
foreach ($event->getAdditionalMounts() as $additionalMount) {
|
||||
$mounts[$additionalMount->getMountPoint()] = $additionalMount;
|
||||
$allMounts[$additionalMount->getMountPoint()] = $mounts[$additionalMount->getMountPoint()] = $additionalMount;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error(
|
||||
|
|
|
|||
Loading…
Reference in a new issue