From 754603a04e24a40778816d9965fe31ac7b407910 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 28 Mar 2022 18:53:20 +0200 Subject: dont needlessly resolve path when getting internalPath/storage from Node Signed-off-by: Robin Appelman --- lib/private/Files/Node/Node.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lib/private/Files/Node/Node.php') diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php index 0f4193d0608..03975146dda 100644 --- a/lib/private/Files/Node/Node.php +++ b/lib/private/Files/Node/Node.php @@ -154,12 +154,11 @@ class Node implements \OCP\Files\Node { } } - /** - * @return \OC\Files\Storage\Storage - * @throws \OCP\Files\NotFoundException - */ public function getStorage() { - [$storage,] = $this->view->resolvePath($this->path); + $storage = $this->getMountPoint()->getStorage(); + if (!$storage) { + throw new \Exception("No storage for node"); + } return $storage; } @@ -174,8 +173,7 @@ class Node implements \OCP\Files\Node { * @return string */ public function getInternalPath() { - [, $internalPath] = $this->view->resolvePath($this->path); - return $internalPath; + return $this->getFileInfo()->getInternalPath(); } /** -- cgit v1.2.3