]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use the standard usage of string.find 10226/head
authorYan Jun <yan.jun8@zte.com.cn>
Sat, 9 Jul 2016 09:43:56 +0000 (17:43 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Sat, 9 Jul 2016 09:50:31 +0000 (17:50 +0800)
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/rgw/rgw_rest_s3.cc

index 23267199c78bdf0b0da6f61cd8cffc4121b7a65d..3b0e75157e97fc4d4d5ed82e3507c723027e2ee3 100644 (file)
@@ -981,8 +981,8 @@ int RGWCreateBucket_ObjStore_S3::get_params()
                      << location_constraint << dendl;
   }
 
-  int pos = location_constraint.find(':');
-  if (pos >= 0) {
+  size_t pos = location_constraint.find(':');
+  if (pos != string::npos) {
     placement_rule = location_constraint.substr(pos + 1);
     location_constraint = location_constraint.substr(0, pos);
   }