mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
optimize adding submount info to directory content
no need to loop when we can do a hashtable lookup Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
9a76f06eca
commit
9f0ba3adc2
1 changed files with 2 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue