Include replier address in operator< for PromiseKey

This commit is contained in:
Tyler Neely 2022-08-01 12:50:48 +00:00
parent 4f4eb9ea13
commit a3f3e05fc2

View File

@ -38,12 +38,18 @@ using memgraph::io::Time;
struct PromiseKey {
Address requester_address;
uint64_t request_id;
// TODO(tyler) possibly remove replier_address from promise key
// once we want to support DSR.
Address replier_address;
public:
bool operator<(const PromiseKey &other) const {
if (requester_address == other.requester_address) {
return request_id < other.request_id;
if (request_id == other.request_id) {
return replier_address < other.replier_address;
} else {
return request_id < other.request_id;
}
} else {
return requester_address < other.requester_address;
}