Skip to content

Commit f0a6c44

Browse files
authored
Merge pull request #42827 from nextcloud/backport/41272/stable28
[stable28] fix: reduce memory consumption of scans
2 parents 14f2461 + d2da9c8 commit f0a6c44

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)