]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: reduce memory consumption of scans 41272/head
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>
Fri, 3 Nov 2023 15:31:02 +0000 (16:31 +0100)
committerGit'Fellow <12234510+solracsf@users.noreply.github.com>
Fri, 3 Nov 2023 17:07:42 +0000 (18:07 +0100)
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Fix lint

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
lib/private/Files/Cache/Cache.php

index 67d01bb6999074332bf88e7cc737ec2ec64124fc..accbc2ce6299073d9249c7f5fa2c4eb974ceca27 100644 (file)
@@ -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();