]> source.dussan.org Git - nextcloud-server.git/commitdiff
cache numeric id in mountpoint
authorRobin Appelman <robin@icewind.nl>
Mon, 6 Feb 2023 17:20:08 +0000 (18:20 +0100)
committerRobin Appelman <robin@icewind.nl>
Mon, 6 Feb 2023 17:20:08 +0000 (18:20 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Mount/MountPoint.php

index 770655fae50618cf3ce132e7e1467a7713de0928..67601f016be7c5993754e54e88168a00f12923d6 100644 (file)
@@ -44,6 +44,7 @@ class MountPoint implements IMountPoint {
        protected $storage = null;
        protected $class;
        protected $storageId;
+       protected $numericStorageId = null;
        protected $rootId = null;
 
        /**
@@ -211,7 +212,10 @@ class MountPoint implements IMountPoint {
         * @return int
         */
        public function getNumericStorageId() {
-               return $this->getStorage()->getStorageCache()->getNumericId();
+               if (is_null($this->numericStorageId)) {
+                       $this->numericStorageId = $this->getStorage()->getStorageCache()->getNumericId();
+               }
+               return $this->numericStorageId;
        }
 
        /**