mirror of
https://github.com/ceph/ceph
synced 2025-01-29 22:43:40 +00:00
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:
parent
a30017fbb9
commit
e2af5b3e5f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user