]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: remove useless length comparison in lifecycle validate.
authorZhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Thu, 12 Jan 2017 01:10:18 +0000 (09:10 +0800)
committerZhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Thu, 12 Jan 2017 01:28:00 +0000 (09:28 +0800)
Signed-off-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
src/rgw/rgw_lc.cc

index 4760ea9d393da64bf53a45dafdea0f134b663709..d311731181a6b5c9b4c9028daa23a572fc38a2c0 100644 (file)
@@ -83,14 +83,8 @@ bool RGWLifecycleConfiguration::validate()
   while (next_iter != prefix_map.end()) {
     string c_pre = cur_iter->first;
     string n_pre = next_iter->first;
-    if (c_pre.length() > n_pre.length()) {
-      if (c_pre.compare(0, n_pre.length(), n_pre) == 0) {
-        return false;
-      }
-    } else {
-      if (n_pre.compare(0, c_pre.length(), c_pre) == 0) {
-        return false;
-      }
+    if (n_pre.compare(0, c_pre.length(), c_pre) == 0) {
+      return false;
     }
     ++next_iter;
     ++cur_iter;