diff options
author | Robin Appelman <robin@icewind.nl> | 2024-02-09 09:54:52 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-03-04 13:57:31 +0100 |
commit | e7a7b4a40184dc3da2c83e858c820625f660e48e (patch) | |
tree | 367bda0ac814376e7c771fbe4b1c40cf7f33df53 /apps/dav/lib/Connector/Sabre/FilesReportPlugin.php | |
parent | 4d110c1dd6ae384c00c93b4e266118004b71e498 (diff) | |
download | nextcloud-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/dav/lib/Connector/Sabre/FilesReportPlugin.php')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesReportPlugin.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php index e43fb740cac..6a8cb3f0f59 100644 --- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php @@ -424,14 +424,14 @@ class FilesReportPlugin extends ServerPlugin { } $folder = $this->userFolder; if (trim($rootNode->getPath(), '/') !== '') { + /** @var Folder $folder */ $folder = $folder->get($rootNode->getPath()); } $results = []; foreach ($fileIds as $fileId) { - $entry = $folder->getById($fileId); + $entry = $folder->getFirstNodeById($fileId); if ($entry) { - $entry = current($entry); $results[] = $this->wrapNode($entry); } } @@ -439,7 +439,7 @@ class FilesReportPlugin extends ServerPlugin { return $results; } - protected function wrapNode(\OCP\Files\File|\OCP\Files\Folder $node): File|Directory { + protected function wrapNode(\OCP\Files\Node $node): File|Directory { if ($node instanceof \OCP\Files\File) { return new File($this->fileView, $node); } else { |