From 8cb5b88cfa29aa4b21eaba34959fefdd04d69339 Mon Sep 17 00:00:00 2001 From: Yan Jun Date: Tue, 5 Jul 2016 11:11:20 +0800 Subject: [PATCH] rgw: optimize the usage of string.find and some indents Signed-off-by: Yan Jun --- src/rgw/rgw_rados.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 9e072479cd6..77d3863d1de 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1962,7 +1962,7 @@ int RGWObjManifest::generator::create_next(uint64_t ofs) if (ofs >= max_head_size) { manifest->set_head_size(max_head_size); cur_stripe = (ofs - max_head_size) / rule.stripe_max_size; - cur_stripe_size = rule.stripe_max_size; + cur_stripe_size = rule.stripe_max_size; if (cur_part_id == 0 && max_head_size > 0) { cur_stripe++; @@ -10491,8 +10491,8 @@ void RGWRados::get_bucket_instance_obj(rgw_bucket& bucket, rgw_obj& obj) int RGWRados::get_bucket_instance_info(RGWObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info, real_time *pmtime, map *pattrs) { - int pos = meta_key.find(':'); - if (pos < 0) { + size_t pos = meta_key.find(':'); + if (pos == string::npos) { return -EINVAL; } string oid = RGW_BUCKET_INSTANCE_MD_PREFIX + meta_key; -- 2.39.5