mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
perf: join array_merge calls in MountProvider::getMountsForUser()
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
parent
2211390ca5
commit
0bd5128d45
1 changed files with 8 additions and 7 deletions
|
|
@ -46,13 +46,14 @@ class MountProvider implements IMountProvider {
|
|||
* @return IMountPoint[]
|
||||
*/
|
||||
public function getMountsForUser(IUser $user, IStorageFactory $loader) {
|
||||
$shares = $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_USER, null, -1);
|
||||
$shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_GROUP, null, -1));
|
||||
$shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_CIRCLE, null, -1));
|
||||
$shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_ROOM, null, -1));
|
||||
$shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_DECK, null, -1));
|
||||
$shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_SCIENCEMESH, null, -1));
|
||||
|
||||
$shares = array_merge(
|
||||
$this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_USER, null, -1),
|
||||
$this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_GROUP, null, -1),
|
||||
$this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_CIRCLE, null, -1),
|
||||
$this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_ROOM, null, -1),
|
||||
$this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_DECK, null, -1),
|
||||
$this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_SCIENCEMESH, null, -1),
|
||||
);
|
||||
|
||||
// filter out excluded shares and group shares that includes self
|
||||
$shares = array_filter($shares, function (IShare $share) use ($user) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue