Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
perf(shares): avoid array_merge in loops
Signed-off-by: Salvatore Martire <[email protected]>
  • Loading branch information
salmart-dev committed Aug 15, 2025
commit 4a0a00a5a221e589b9e000d68df25253f9d9c668
10 changes: 5 additions & 5 deletions apps/dav/lib/Connector/Sabre/SharesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,28 @@ private function getShare(Node $node): array {
];

foreach ($requestedShareTypes as $requestedShareType) {
$result = array_merge($result, $this->shareManager->getSharesBy(
$result[] = $this->shareManager->getSharesBy(
$this->userId,
$requestedShareType,
$node,
false,
-1
));
);

// Also check for shares where the user is the recipient
try {
$result = array_merge($result, $this->shareManager->getSharedWith(
$result[] = $this->shareManager->getSharedWith(
$this->userId,
$requestedShareType,
$node,
-1
));
);
} catch (BackendError $e) {
// ignore
}
}

return $result;
return array_merge(...$result);
}

/**
Expand Down
Loading