[CP] fix blacklist compare blkey use hash value erroneously

This commit is contained in:
dimstars
2024-10-14 13:14:07 +00:00
committed by ob-robot
parent ef91a3d5a4
commit 8f665df6a8

View File

@ -95,15 +95,19 @@ public:
} }
int compare(const ObBLKey &other) const int compare(const ObBLKey &other) const
{ {
int ret = server_.compare(other.server_); int ret = 0;
if (0 == ret) { if (this == &other) {
if (tenant_id_ > other.tenant_id_) { ret = 0;
} else if (0 != (ret = server_.compare(other.get_server()))) {
// do nothing
} else if (0 != (ret = ls_id_.compare(other.get_ls_id()))) {
// do nothing
} else if (tenant_id_ > other.tenant_id_) {
ret = 1; ret = 1;
} else if (tenant_id_ < other.tenant_id_) { } else if (tenant_id_ < other.tenant_id_) {
ret = -1; ret = -1;
} else { } else {
ret = ls_id_.compare(other.ls_id_); ret = 0;
}
} }
return ret; return ret;
} }