From: Yan Jun Date: Sat, 9 Jul 2016 09:43:56 +0000 (+0800) Subject: rgw: use the standard usage of string.find X-Git-Tag: ses5-milestone5~189^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b84039adeb5ee3201b6e9ec658696a8cde3487af;p=ceph.git rgw: use the standard usage of string.find Signed-off-by: Yan Jun --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 23267199c78b..3b0e75157e97 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -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); }