Quellcode durchsuchen

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>
tags/v25.0.0beta1
Robin Appelman vor 2 Jahren
Ursprung
Commit
9f0ba3adc2
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
1 geänderte Dateien mit 2 neuen und 4 gelöschten Zeilen
  1. 2
    4
      lib/private/Files/View.php

+ 2
- 4
lib/private/Files/View.php Datei anzeigen

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

Laden…
Abbrechen
Speichern