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/files_reminders/lib/Notification | |
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/files_reminders/lib/Notification')
-rw-r--r-- | apps/files_reminders/lib/Notification/Notifier.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/files_reminders/lib/Notification/Notifier.php b/apps/files_reminders/lib/Notification/Notifier.php index f7ffa0b4437..a280c4d9336 100644 --- a/apps/files_reminders/lib/Notification/Notifier.php +++ b/apps/files_reminders/lib/Notification/Notifier.php @@ -69,11 +69,10 @@ class Notifier implements INotifier { $params = $notification->getSubjectParameters(); $fileId = $params['fileId']; - $nodes = $this->root->getUserFolder($notification->getUser())->getById($fileId); - if (empty($nodes)) { + $node = $this->root->getUserFolder($notification->getUser())->getFirstNodeById($fileId); + if (!$node) { throw new InvalidArgumentException(); } - $node = reset($nodes); $path = rtrim($node->getPath(), '/'); if (strpos($path, '/' . $notification->getUser() . '/files/') === 0) { |