Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-03-28 19:53:20 +0300
committerRobin Appelman <robin@icewind.nl>2022-04-04 16:40:24 +0300
commit754603a04e24a40778816d9965fe31ac7b407910 (patch)
tree418ba20b6656f70c51461f7428178e38fe154aa1 /lib
parent8b12c75ca258787591d765d301adb57bb4e53d26 (diff)
dont needlessly resolve path when getting internalPath/storage from Node
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Node/Node.php12
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();
}
/**