Implement FN (lambda shortener)

Useful for some higher order functions.
Allows to make short lambdas even shorter.
This commit is contained in:
Nekotekina 2022-06-30 20:56:34 +03:00 committed by Ivan
parent 5c6f5a1610
commit 4b787b22c8
12 changed files with 80 additions and 72 deletions

View file

@ -13,13 +13,13 @@ namespace rpcs3::cache
std::string get_ppu_cache()
{
auto& _main = g_fxo->get<ppu_module>();
if (!g_fxo->is_init<ppu_module>() || _main.cache.empty())
{
ppu_log.error("PPU Cache location not initialized.");
return {};
}
return _main.cache;
}
@ -75,10 +75,7 @@ namespace rpcs3::cache
cache_dir.close();
// sort oldest first
std::sort(file_list.begin(), file_list.end(), [](auto left, auto right)
{
return left.mtime < right.mtime;
});
std::sort(file_list.begin(), file_list.end(), FN(x.mtime < y.mtime));
// keep removing until cache is empty or enough bytes have been cleared
// cache is cleared down to 80% of limit to increase interval between clears