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
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-04-22 16:50:14 +0300
committerRobin Appelman <robin@icewind.nl>2022-04-22 16:50:14 +0300
commit9f0ba3adc223987125c49367b4eeb7558b16e367 (patch)
tree7952820e88af91c43c0537f75386e1d81cf0d21a
parent9a76f06ecadf05ef1d26bd735df1bea0dfb15d59 (diff)
optimize adding submount info to directory contentdirectory-listing-optimize-add-submount
no need to loop when we can do a hashtable lookup Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/private/Files/View.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 30dc5518be8..e49dc766c88 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1517,10 +1517,8 @@ class View {
if ($pos = strpos($relativePath, '/')) {
//mountpoint inside subfolder add size to the correct folder
$entryName = substr($relativePath, 0, $pos);
- foreach ($files as &$entry) {
- if ($entry->getName() === $entryName) {
- $entry->addSubEntry($rootEntry, $mountPoint);
- }
+ if (isset($files[$entryName])) {
+ $files[$entryName]->addSubEntry($rootEntry, $mountPoint);
}
} else { //mountpoint in this folder, add an entry for it
$rootEntry['name'] = $relativePath;