🐛 fixed last commit

This commit is contained in:
EntireTwix 2021-07-19 22:35:51 -07:00
parent 9212edb9a3
commit 1df473f49a

View file

@ -245,10 +245,9 @@ BankResponse Bank::DelUser(const std::string &name) noexcept
if (users.if_contains(name, [&bal](const User &u) { bal = u.balance; }) && if (users.if_contains(name, [&bal](const User &u) { bal = u.balance; }) &&
bal) bal)
{ {
users.modify_if(return_account, [bal](User & u)) users.modify_if(return_account, [bal](User &u) {
{
u.balance += bal; u.balance += bal;
} });
} }
#endif #endif
std::shared_lock<std::shared_mutex> lock{iter_lock}; std::shared_lock<std::shared_mutex> lock{iter_lock};
@ -276,10 +275,9 @@ void Bank::DelSelf(const std::string &name) noexcept
if (users.if_contains(name, [&bal](const User &u) { bal = u.balance; }) && if (users.if_contains(name, [&bal](const User &u) { bal = u.balance; }) &&
bal) bal)
{ {
users.modify_if(return_account, [bal](User & u)) users.modify_if(return_account, [bal](User &u) {
{
u.balance += bal; u.balance += bal;
} });
} }
#endif #endif
#if CONSERVATIVE_DISK_SAVE #if CONSERVATIVE_DISK_SAVE