aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2023-11-28 11:36:59 +0100
committerGitHub <noreply@github.com>2023-11-28 11:36:59 +0100
commit394cd75322bc6fc0c1c4613162c330a995ae5ded (patch)
tree3fcb38267863b718eca266a84457725a979f9bdd /lib
parent258c863c5e4610a0399dd71f3276dc01146a0947 (diff)
parentb4a377311504bbb29fe68a0349fc0ba6075641c2 (diff)
downloadnextcloud-server-394cd75322bc6fc0c1c4613162c330a995ae5ded.tar.gz
nextcloud-server-394cd75322bc6fc0c1c4613162c330a995ae5ded.zip
Merge pull request #41272 from nextcloud/fixOccScans
fix: reduce memory consumption of scans
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Cache.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index c09087b43ae..052b3c75ce8 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -606,9 +606,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();