Skip to content

Commit

Permalink
cleanup: refactor local_write_set::push to use move constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Jan 24, 2025
1 parent 2c7c534 commit cabeee9
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/concurrency_control/local_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ void local_write_set::push(Token token, write_set_obj&& elem) {
std::lock_guard<std::shared_mutex> lk{get_mtx()};

if (get_for_batch()) {
if (elem.get_op() == OP_TYPE::DELETE) {
cont_for_bt_.insert_or_assign(elem.get_rec_ptr(),
write_set_obj(elem.get_storage(),
elem.get_op(),
elem.get_rec_ptr()));
} else {
cont_for_bt_.insert_or_assign(
elem.get_rec_ptr(),
write_set_obj(elem.get_storage(), elem.get_op(),
elem.get_rec_ptr(), elem.get_value_view(),
elem.get_inc_tombstone()));
}

if (static_cast<session*>(token)->get_tx_type() ==
transaction_options::transaction_type::LONG) {
// update storage map
Expand All @@ -68,6 +55,8 @@ void local_write_set::push(Token token, write_set_obj&& elem) {
}
}
}
auto* rec_ptr = elem.get_rec_ptr();
cont_for_bt_.insert_or_assign(rec_ptr, std::move(elem));
} else {
cont_for_occ_.emplace_back(std::move(elem)); // NOLINT
if (cont_for_occ_.size() > 100) { // NOLINT
Expand Down

0 comments on commit cabeee9

Please sign in to comment.