From: xie xingguo Date: Tue, 27 Mar 2018 09:11:57 +0000 (+0800) Subject: common/hobject: compare two objects' key directly X-Git-Tag: v13.1.0~459^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1754fc39086c52281d9b1c4b6a620b3c1dda4978;p=ceph.git common/hobject: compare two objects' key directly 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 --- diff --git a/src/common/hobject.cc b/src/common/hobject.cc index 99b8b944097b3..2c80727cf8a57 100644 --- a/src/common/hobject.cc +++ b/src/common/hobject.cc @@ -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;