Skip to content

Commit 394cd75

Browse files
authored
Merge pull request #41272 from nextcloud/fixOccScans
fix: reduce memory consumption of scans
2 parents 258c863 + b4a3773 commit 394cd75

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/private/Files/Cache/Cache.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,12 @@ private function removeChildren(ICacheEntry $entry) {
606606
}
607607

608608
/** @var ICacheEntry[] $childFolders */
609-
$childFolders = array_filter($children, function ($child) {
610-
return $child->getMimeType() == FileInfo::MIMETYPE_FOLDER;
611-
});
609+
$childFolders = [];
610+
foreach ($children as $child) {
611+
if ($child->getMimeType() == FileInfo::MIMETYPE_FOLDER) {
612+
$childFolders[] = $child;
613+
}
614+
}
612615
foreach ($childFolders as $folder) {
613616
$parentIds[] = $folder->getId();
614617
$queue[] = $folder->getId();

0 commit comments

Comments
 (0)