Remove bool variable 'same_email' compare emails directly in
if check.
Fix for:
[src/rgw/rgw_user.cc:1926] -> [src/rgw/rgw_user.cc:1927]: (performance)
Variable 'same_email' is reassigned a value before the old one has been used.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
std::string old_email = old_info.user_email;
if (!op_email.empty()) {
- bool same_email = false;
- same_email = (old_email.compare(op_email) == 0);
-
// make sure we are not adding a duplicate email
- if (!same_email) {
+ if (old_email.compare(op_email) != 0) {
ret = rgw_get_user_info_by_email(store, op_email, duplicate_check);
if (ret >= 0 && duplicate_check.user_id != user_id) {
set_err_msg(err_msg, "cannot add duplicate email");