[QUEUED scylla next] utils: int_range: change to std::strong_ordering

0 views
Skip to first unread message

Commit Bot

<bot@cloudius-systems.com>
unread,
Jul 29, 2021, 3:44:31 PM7/29/21
to scylladb-dev@googlegroups.com, Avi Kivity
From: Avi Kivity <a...@scylladb.com>
Committer: Avi Kivity <a...@scylladb.com>
Branch: next

utils: int_range: change to std::strong_ordering

Ref #1449.

---
diff --git a/utils/int_range.hh b/utils/int_range.hh
--- a/utils/int_range.hh
+++ b/utils/int_range.hh
@@ -43,7 +43,7 @@ unsigned cardinality(const std::optional<int_range>& ropt) {
inline
std::optional<int_range> intersection(const int_range& a, const int_range& b) {
auto int_tri_cmp = [] (int x, int y) {
- return x < y ? -1 : (x > y ? 1 : 0);
+ return x <=> y;
};
return a.intersection(b, int_tri_cmp);
}

Commit Bot

<bot@cloudius-systems.com>
unread,
Jul 29, 2021, 9:40:20 PM7/29/21
to scylladb-dev@googlegroups.com, Avi Kivity
From: Avi Kivity <a...@scylladb.com>
Committer: Avi Kivity <a...@scylladb.com>
Branch: master
Reply all
Reply to author
Forward
0 new messages