cleaning code

This commit is contained in:
EntireTwix 2021-04-04 21:56:22 -07:00
parent ef0e4859d1
commit 6a1fbe23a1

View file

@ -98,17 +98,17 @@ public:
}); });
return res; return res;
} }
int_fast16_t VerifyPassword(const std::string &name, const std::string &attempt) const int_fast8_t VerifyPassword(const std::string &name, const std::string &attempt) const
{ {
int_fast16_t res = -1; int_fast8_t res = -1;
users.if_contains(name, [&res, &attempt](const User &u) { users.if_contains(name, [&res, &attempt](const User &u) {
res = u.password == attempt; res = u.password == attempt;
}); });
return res; return res;
} }
int_fast16_t ChangePassword(const std::string &name, const std::string &attempt, std::string &&new_pass) int_fast8_t ChangePassword(const std::string &name, const std::string &attempt, std::string &&new_pass)
{ {
int_fast16_t res = -1; int_fast8_t res = -1;
users.modify_if(name, [&res, &attempt, &new_pass](User &u) { users.modify_if(name, [&res, &attempt, &new_pass](User &u) {
res = (u.password == attempt); res = (u.password == attempt);
if (res) if (res)