Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit ac0a760

Browse files
committed
Slight logic change in RecordUpdate.
1 parent 2aed22b commit ac0a760

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: src/concurrency/transaction_context.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,13 @@ void TransactionContext::RecordUpdate(const ItemPointer &location) {
115115
(rw_set_[location] != RWType::DELETE &&
116116
rw_set_[location] != RWType::INS_DEL));
117117
auto rw_set_it = rw_set_.find(location);
118-
if (rw_set_it != rw_set_.end() && (rw_set_it->second == RWType::READ ||
119-
rw_set_it->second == RWType::READ_OWN)) {
120-
rw_set_it->second = RWType::UPDATE;
118+
if (rw_set_it != rw_set_.end() {
119+
if (rw_set_it->second == RWType::READ || rw_set_it->second == RWType::READ_OWN) {
120+
rw_set_it->second = RWType::UPDATE;
121+
}
122+
return;
121123
}
124+
rw_set_[location] = RWType::UPDATE;
122125
}
123126

124127
void TransactionContext::RecordInsert(const ItemPointer &location) {

0 commit comments

Comments
 (0)