diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2024-01-16 19:17:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-16 19:17:23 +0100 |
commit | f0a6c4429d45848846eed4ea8f3e67ec5aa33e53 (patch) | |
tree | 6013932e1da8b1e7745ab2df41deabb4a2b4f8e1 | |
parent | 14f2461aefef7633a505f75f276a77fdec682a66 (diff) | |
parent | d2da9c8fbef957da6f2bbeabaf180e3a28448b2b (diff) | |
download | nextcloud-server-f0a6c4429d45848846eed4ea8f3e67ec5aa33e53.tar.gz nextcloud-server-f0a6c4429d45848846eed4ea8f3e67ec5aa33e53.zip |
Merge pull request #42827 from nextcloud/backport/41272/stable28
[stable28] fix: reduce memory consumption of scans
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 9 |
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(); |