]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_acl_s3.cc: prefer prefix ++operator for iterators
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 15 Mar 2013 11:31:13 +0000 (12:31 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 18 Mar 2013 11:35:38 +0000 (12:35 +0100)
Prefer prefix ++operator for iterators, move some iterator declaration into
the for-loop header, since the iterator is only used within the loops.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rgw/rgw_acl_s3.cc

index 79cf2ced2333ef212c99a5d39b5971a80937dd1f..4f26dda7d202d1682f71ac32c34dbfcc320738a7 100644 (file)
@@ -328,8 +328,7 @@ static int parse_acl_header(RGWRados *store, RGWEnv *env,
   hacl_str = hacl;
   get_str_list(hacl_str, ",", grantees);
 
-  list<string>::iterator it = grantees.begin();
-  for (; it != grantees.end(); it++) {
+  for (list<string>::iterator it = grantees.begin(); it != grantees.end(); ++it) {
     ACLGrant grant;
     int ret = parse_grantee_str(store, *it, perm, grant);
     if (ret < 0)
@@ -395,8 +394,7 @@ int RGWAccessControlList_S3::create_from_grants(std::list<ACLGrant>& grants)
   acl_user_map.clear();
   grant_map.clear();
 
-  std::list<ACLGrant>::iterator it = grants.begin();
-  for (; it != grants.end(); it++) {
+  for (std::list<ACLGrant>::iterator it = grants.begin(); it != grants.end(); ++it) {
     ACLGrant g = *it;
     add_grant(&g);
   }