🐛 fixing last commit

This commit is contained in:
EntireTwix 2022-12-18 17:22:12 -08:00
parent d63be0ec73
commit 5e253e42d9

View file

@ -232,16 +232,26 @@ BankResponse Bank::PruneUsers(uint32_t threshold_bal) noexcept
#endif
for (const auto &u : users)
{
#if MAX_LOG_SIZE > 0
#if RETURN_ON_DEL
if (Bank::users.erase_if(u.first, [threshold_bal, &bal, &deleted_count](User &u) {
if (Bank::users.erase_if(u.first, [threshold_time, threshold_bal, &bal, &deleted_count](User &u) {
bal += u.balance;
#else
if (Bank::users.erase_if(u.first, [threshold_time, threshold_bal, &deleted_count](User &u) {
#endif
#if MAX_LOG_SIZE > 0
return ((!u.log.data.size() || u.log.data.back().time < threshold_time) && u.balance < threshold_bal);
#else
#if RETURN_ON_DEL
if (Bank::users.erase_if(u.first, [threshold_bal, &bal, &deleted_count](User &u) {
bal += u.balance;
#else
if (Bank::users.erase_if(u.first, [threshold_bal, &deleted_count](User &u) {
#endif
return (u.balance < threshold_bal);
#endif
}))
{