rgw/rgw_user.cc: use empty() to check for emptiness

Use !empty() instead of 'size()' to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2013-02-13 18:47:54 +01:00 committed by Greg Farnum
parent a30017fbb9
commit e2af5b3e5f

View File

@ -56,7 +56,7 @@ int rgw_store_user_info(RGWRados *store, RGWUserInfo& info, RGWUserInfo *old_inf
}
}
if (info.access_keys.size()) {
if (!info.access_keys.empty()) {
/* check if access keys already exist */
RGWUserInfo inf;
map<string, RGWAccessKey>::iterator iter = info.access_keys.begin();
@ -95,7 +95,7 @@ int rgw_store_user_info(RGWRados *store, RGWUserInfo& info, RGWUserInfo *old_inf
}
}
if (info.access_keys.size()) {
if (!info.access_keys.empty()) {
map<string, RGWAccessKey>::iterator iter = info.access_keys.begin();
for (; iter != info.access_keys.end(); ++iter) {
RGWAccessKey& k = iter->second;