From e3bafcc7a813f6adb305c2e35057b925c278d4bd Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 6 Feb 2023 18:20:08 +0100 Subject: cache numeric id in mountpoint Signed-off-by: Robin Appelman --- lib/private/Files/Mount/MountPoint.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/Files/Mount/MountPoint.php b/lib/private/Files/Mount/MountPoint.php index 770655fae50..67601f016be 100644 --- a/lib/private/Files/Mount/MountPoint.php +++ b/lib/private/Files/Mount/MountPoint.php @@ -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; } /** -- cgit v1.2.3