Fix performance on threaded view in large folders

This commit is contained in:
David Edler 2022-05-24 19:39:27 +02:00 committed by GitHub
parent 4c752f9a15
commit 1cd7493bf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -901,10 +901,12 @@ class MailClient
$aUids = $this->GetUids($oParams->oCacher, '',
$oMessageCollection->FolderName, $oMessageCollection->FolderHash, $bUseSortIfSupported, $oParams->sSort);
// Remove all threaded UID's except the most recent of each thread
$threadedUids = [];
foreach ($aAllThreads as $aMap) {
unset($aMap[\array_key_last($aMap)]);
$aUids = \array_diff($aUids, $aMap);
$threadedUids = \array_merge($threadedUids, $aMap);
}
$aUids = \array_diff($aUids, $threadedUids);
}
} else {
$aUids = $this->GetUids($oParams->oCacher, '',