Revert "[TASK] Avoid slow array functions in loops"
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Tree / View / FolderTreeView.php
index 01b55fe..bbdef5a 100644 (file)
@@ -266,14 +266,14 @@ class FolderTreeView extends AbstractTreeView
         // Get stored tree structure AND updating it if needed according to incoming PM GET var.
         $this->initializePositionSaving();
         // Init done:
-        $treeItems = [[]];
+        $treeItems = [];
         // Traverse mounts:
         foreach ($this->storages as $storageObject) {
             $this->getBrowseableTreeForStorage($storageObject);
             // Add tree:
-            $treeItems[] = $this->tree;
+            $treeItems = array_merge($treeItems, $this->tree);
         }
-        return $this->printTree(array_merge(...$treeItems));
+        return $this->printTree($treeItems);
     }
 
     /**