]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: subtle optimization and cleanups 10299/head
authorYan Jun <yan.jun8@zte.com.cn>
Thu, 14 Jul 2016 16:17:01 +0000 (00:17 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Thu, 14 Jul 2016 16:22:24 +0000 (00:22 +0800)
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/rgw/rgw_metadata.cc
src/rgw/rgw_rados.cc

index 3160ce0b19896c6312902fa6df955bdfe47bd44c..7cc4cad3b5859d4ff9e56237cf5cdb2b1f554165 100644 (file)
@@ -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);
index d32f9b43d6e0cc2bceb67fdebb3303735d368009..695f053151e2aae46ad340eb61f256820b45d346 100644 (file)
@@ -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<cls_log_entry>& entries,