]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/hobject: compare two objects' key directly 21062/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 27 Mar 2018 09:11:57 +0000 (17:11 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 27 Mar 2018 10:11:21 +0000 (18:11 +0800)
The original implement does not appear to be a problem for two different
objects which are usually of different oids/names.
However, for a specific head object and its posterity snap objects, this
is not very effective since we are going to compare oids/names twice
(because they are definitely equivalent).

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/common/hobject.cc

index 99b8b944097b3312aae5450d1867249feb060274..2c80727cf8a5748673bba1535ed99037f2513566 100644 (file)
@@ -336,9 +336,9 @@ int cmp(const hobject_t& l, const hobject_t& r)
     return -1;
   if (l.nspace > r.nspace)
     return 1;
-  if (l.get_effective_key() < r.get_effective_key())
+  if (l.get_key() < r.get_key())
     return -1;
-  if (l.get_effective_key() > r.get_effective_key())
+  if (l.get_key() > r.get_key())
     return 1;
   if (l.oid < r.oid)
     return -1;