Merge pull request #32138 from nextcloud/stable24-directory-listing-optimize-add-submount

[stable24] optimize adding submount info to directory content
This commit is contained in:
Vincent Petry 2022-04-25 19:33:58 +02:00 committed by GitHub
commit ff64a731b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;