mirror of
https://github.com/ceph/ceph
synced 2025-02-22 02:27:29 +00:00
os/bluestore: avoid comparing object key and name twice
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
parent
bea0e347c0
commit
adb274c631
@ -276,11 +276,9 @@ static void get_object_key(const ghobject_t& oid, string *key)
|
||||
// is a key... could be < = or >.
|
||||
append_escaped(oid.hobj.get_key(), key);
|
||||
// (ASCII chars < = and > sort in that order, yay)
|
||||
if (oid.hobj.get_key() < oid.hobj.oid.name) {
|
||||
key->append("<");
|
||||
append_escaped(oid.hobj.oid.name, key);
|
||||
} else if (oid.hobj.get_key() > oid.hobj.oid.name) {
|
||||
key->append(">");
|
||||
int r = oid.hobj.get_key().compare(oid.hobj.oid.name);
|
||||
if (r) {
|
||||
key->append(r > 0 ? ">" : "<");
|
||||
append_escaped(oid.hobj.oid.name, key);
|
||||
} else {
|
||||
// same as no key
|
||||
|
Loading…
Reference in New Issue
Block a user