diff --git a/src/rgw/rgw_metadata.cc b/src/rgw/rgw_metadata.cc index 3160ce0b198..7cc4cad3b58 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 3e0a55b0449..bfacb8360da 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4559,8 +4559,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,