aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-02-09 09:54:52 +0100
committerRobin Appelman <robin@icewind.nl>2024-03-04 13:57:31 +0100
commite7a7b4a40184dc3da2c83e858c820625f660e48e (patch)
tree367bda0ac814376e7c771fbe4b1c40cf7f33df53 /apps/federatedfilesharing
parent4d110c1dd6ae384c00c93b4e266118004b71e498 (diff)
downloadnextcloud-server-e7a7b4a40184dc3da2c83e858c820625f660e48e.tar.gz
nextcloud-server-e7a7b4a40184dc3da2c83e858c820625f660e48e.zip
perf: switch places that always use the first getById result to getFirstNodeById
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index 69813289cae..45efd0c7c8a 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -880,7 +880,7 @@ class FederatedShareProvider implements IShareProvider {
*
* @param string $userId
* @param int $id
- * @return \OCP\Files\File|\OCP\Files\Folder
+ * @return \OCP\Files\Node
* @throws InvalidShare
*/
private function getNode($userId, $id) {
@@ -890,13 +890,13 @@ class FederatedShareProvider implements IShareProvider {
throw new InvalidShare();
}
- $nodes = $userFolder->getById($id);
+ $node = $userFolder->getFirstNodeById($id);
- if (empty($nodes)) {
+ if (!$node) {
throw new InvalidShare();
}
- return $nodes[0];
+ return $node;
}
/**