range_tombstone(_list): Mark some bits noexcept

The range_tombstone's .empty() and .operator bool are trivially such.

The swap()'s noexceptness comes from what it calls -- the without-link
move constructor (noexcept) and .move_assign(). The latter is noexcept
because it's already called from noexcept move-assign operator and
because it calls noexcept move operators of tombstones' fields. The
update_node() is noexcept for the same reason.

The range_tombstone_list's clear() is noexcept because both -- set
clear and disposer lambda are both such.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2021-09-03 15:11:50 +03:00
parent 87ce46d1c6
commit fcc02c6bed
2 changed files with 6 additions and 6 deletions

View File

@@ -97,10 +97,10 @@ public:
// Range tombstone covers all rows with positions p such that: position() <= p < end_position()
position_in_partition_view position() const;
position_in_partition_view end_position() const;
bool empty() const {
bool empty() const noexcept {
return !bool(tomb);
}
explicit operator bool() const {
explicit operator bool() const noexcept {
return bool(tomb);
}
bool equal(const schema& s, const range_tombstone& other) const {
@@ -113,7 +113,7 @@ public:
return _c(rt1.start_bound(), rt2.start_bound());
}
};
friend void swap(range_tombstone& rt1, range_tombstone& rt2) {
friend void swap(range_tombstone& rt1, range_tombstone& rt2) noexcept {
range_tombstone tmp(std::move(rt2), without_link());
rt2.move_assign(std::move(rt1));
rt1.move_assign(std::move(tmp));
@@ -215,14 +215,14 @@ public:
return sizeof(range_tombstone) + minimal_external_memory_usage(s);
}
private:
void move_assign(range_tombstone&& rt) {
void move_assign(range_tombstone&& rt) noexcept {
start = std::move(rt.start);
start_kind = rt.start_kind;
end = std::move(rt.end);
end_kind = rt.end_kind;
tomb = std::move(rt.tomb);
}
void update_node(bi::set_member_hook<bi::link_mode<bi::auto_unlink>>& other_link) {
void update_node(bi::set_member_hook<bi::link_mode<bi::auto_unlink>>& other_link) noexcept {
if (other_link.is_linked()) {
// Move the link in case we're being relocated by LSA.
container_type::node_algorithms::replace_node(other_link.this_ptr(), _link.this_ptr());

View File

@@ -198,7 +198,7 @@ public:
}
}
}
void clear() {
void clear() noexcept {
_tombstones.clear_and_dispose(current_deleter<range_tombstone>());
}