[PowerRename] Remember last window size and optimize sorting (#27978)

We don't need to sort deeper layers, because they're being enumerated using explorer API and will appear in order anyway
This commit is contained in:
Andrey Nekrasov
2023-08-14 21:43:31 +02:00
committed by GitHub
parent 1d35263e4a
commit 7ab2717b09
8 changed files with 53 additions and 3 deletions

View File

@@ -102,7 +102,10 @@ HRESULT CPowerRenameEnum::_ParseEnumItems(_In_ IEnumShellItems* pesi, _In_ int d
l->Compare(r, SICHINT_DISPLAY, &res);
return res < 0;
};
std::sort(begin(items), end(items), cmpShellItems);
// We need to sort only the first layer, because later ones are enumerated correctly
if (depth == 0)
std::sort(begin(items), end(items), cmpShellItems);
for (const auto& item : items)
{