]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: remove useless code in inode_backtrace_t::compare
authorYan, Zheng <zyan@redhat.com>
Mon, 17 Oct 2016 07:09:45 +0000 (15:09 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 17 Oct 2016 07:23:21 +0000 (15:23 +0800)
if (ancestors[i-1].version < other.ancestors[i-1].version),
variable comparator must be -1.
if (ancestors[i-1].version < other.ancestors[i-1].version),
variable comparator must be 1.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/inode_backtrace.cc

index c6023dfa48e984f6113145b3d603f0500a99b695..314f1751b5e0ef7381e888edac1acc9c0f39638d 100644 (file)
@@ -145,18 +145,7 @@ int inode_backtrace_t::compare(const inode_backtrace_t& other,
     if (ancestors[i].dirino != other.ancestors[i].dirino ||
         ancestors[i].dname != other.ancestors[i].dname) {
       *equivalent = false;
-      if (ancestors[i-1].version < other.ancestors[i-1].version) {
-        if (comparator > 0)
-          *divergent = true;
-        return -1;
-      } else if (ancestors[i-1].version > other.ancestors[i-1].version) {
-        if (comparator < 0)
-          *divergent = true;
-        return 1;
-      } else {
-        assert(ancestors[i-1].version == other.ancestors[i-1].version);
-        return 0;
-      }
+      return comparator;
     } else if (ancestors[i].version > other.ancestors[i].version) {
       if (comparator < 0)
         *divergent = true;