Skip to content

Commit 9e4ea44

Browse files
committed
fixing bug in comparison operator
1 parent b959007 commit 9e4ea44

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

include/reactor-cpp/connection_properties.hh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ struct ConnectionProperties {
2121
Environment* enclave_{nullptr};
2222

2323
auto operator<(const ConnectionProperties& elem2) const noexcept -> bool {
24-
return this->type_ < elem2.type_ && this->delay_ < elem2.delay_;
24+
return (this->type_ < elem2.type_) || (this->type_ == elem2.type_ && this->delay_ < elem2.delay_);
25+
}
26+
27+
auto operator==(const ConnectionProperties& elem2) const noexcept -> bool {
28+
return this->type_ == elem2.type_ && this->delay_ == elem2.delay_;
2529
}
2630
};
2731

include/reactor-cpp/graph.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ private:
2525
using map_key = std::pair<E, P>;
2626
struct map_key_compare {
2727
auto operator()(const map_key& left_site, const map_key& right_site) const -> bool {
28-
return left_site.first < right_site.first && left_site.second < right_site.second;
28+
return left_site.first < right_site.first ||
29+
(left_site.second == right_site.second && left_site.second < right_site.second);
2930
}
3031
};
3132

0 commit comments

Comments
 (0)