From: Yan Jun Date: Thu, 14 Jul 2016 16:17:01 +0000 (+0800) Subject: rgw: subtle optimization and cleanups X-Git-Tag: ses5-milestone5~190^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ee99c1f730dc18be65f417dbef67d4b08e04f065;p=ceph.git rgw: subtle optimization and cleanups Signed-off-by: Yan Jun --- diff --git a/src/rgw/rgw_metadata.cc b/src/rgw/rgw_metadata.cc index 3160ce0b1989..7cc4cad3b585 100644 --- a/src/rgw/rgw_metadata.cc +++ b/src/rgw/rgw_metadata.cc @@ -518,8 +518,8 @@ RGWMetadataHandler *RGWMetadataManager::get_handler(const string& type) void RGWMetadataManager::parse_metadata_key(const string& metadata_key, string& type, string& entry) { - int pos = metadata_key.find(':'); - if (pos < 0) { + auto pos = metadata_key.find(':'); + if (pos == string::npos) { type = metadata_key; } else { type = metadata_key.substr(0, pos); diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index d32f9b43d6e0..695f053151e2 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4482,8 +4482,7 @@ int RGWRados::time_log_add(const string& oid, const real_time& ut, const string& utime_t t(ut); cls_log_add(op, t, section, key, bl); - r = io_ctx.operate(oid, &op); - return r; + return io_ctx.operate(oid, &op); } int RGWRados::time_log_add(const string& oid, list& entries,