Skip to content

Commit

Permalink
fix: reduce memory consumption of scans
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Fix lint

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
  • Loading branch information
solracsf authored and skjnldsv committed Jan 16, 2024
1 parent 21042c3 commit d2da9c8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,12 @@ private function removeChildren(ICacheEntry $entry) {
}

/** @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();
Expand Down

0 comments on commit d2da9c8

Please sign in to comment.