diff options
author | Robin Appelman <robin@icewind.nl> | 2022-03-28 18:53:20 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-04-04 15:40:24 +0200 |
commit | 754603a04e24a40778816d9965fe31ac7b407910 (patch) | |
tree | 418ba20b6656f70c51461f7428178e38fe154aa1 /lib/private/Files/Node/Node.php | |
parent | 8b12c75ca258787591d765d301adb57bb4e53d26 (diff) | |
download | nextcloud-server-754603a04e24a40778816d9965fe31ac7b407910.tar.gz nextcloud-server-754603a04e24a40778816d9965fe31ac7b407910.zip |
dont needlessly resolve path when getting internalPath/storage from Node
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Node/Node.php')
-rw-r--r-- | lib/private/Files/Node/Node.php | 12 |
1 files changed, 5 insertions, 7 deletions
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(); } /** |