From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:31:02 +0000 (+0100) Subject: fix: reduce memory consumption of scans X-Git-Tag: v29.0.0beta1~772^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b4a377311504bbb29fe68a0349fc0ba6075641c2;p=nextcloud-server.git fix: reduce memory consumption of scans Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Fix lint Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 67d01bb6999..accbc2ce629 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -599,9 +599,12 @@ class Cache implements ICache { } /** @var ICacheEntry[] $childFolders */ - $childFolders = array_filter($children, function ($child) { - return $child->getMimeType() == FileInfo::MIMETYPE_FOLDER; - }); + $childFolders = []; + foreach ($children as $child) { + if ($child->getMimeType() == FileInfo::MIMETYPE_FOLDER) { + $childFolders[] = $child; + } + } foreach ($childFolders as $folder) { $parentIds[] = $folder->getId(); $queue[] = $folder->getId();