From b84039adeb5ee3201b6e9ec658696a8cde3487af Mon Sep 17 00:00:00 2001 From: Yan Jun Date: Sat, 9 Jul 2016 17:43:56 +0800 Subject: [PATCH] rgw: use the standard usage of string.find Signed-off-by: Yan Jun --- src/rgw/rgw_rest_s3.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.47.3