From: Zhang Shaowen Date: Thu, 12 Jan 2017 01:10:18 +0000 (+0800) Subject: rgw: remove useless length comparison in lifecycle validate. X-Git-Tag: v12.0.0~149^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a142de3a9be5a448066b786156aff6f05907fb8e;p=ceph-ci.git rgw: remove useless length comparison in lifecycle validate. Signed-off-by: Zhang Shaowen --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 4760ea9d393..d311731181a 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -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;