From e7a7b4a40184dc3da2c83e858c820625f660e48e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 9 Feb 2024 09:54:52 +0100 Subject: perf: switch places that always use the first getById result to getFirstNodeById Signed-off-by: Robin Appelman --- core/Command/Preview/Generate.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'core/Command/Preview') diff --git a/core/Command/Preview/Generate.php b/core/Command/Preview/Generate.php index a885d224fc7..86528319199 100644 --- a/core/Command/Preview/Generate.php +++ b/core/Command/Preview/Generate.php @@ -121,11 +121,7 @@ class Generate extends Command { } $mount = $mounts[0]; $userFolder = $this->rootFolder->getUserFolder($mount->getUser()->getUID()); - $nodes = $userFolder->getById((int)$fileInput); - if (!$nodes) { - return null; - } - return $nodes[0]; + return $userFolder->getFirstNodeById((int)$fileInput); } else { try { return $this->rootFolder->get($fileInput); -- cgit v1.2.3