Skip to content

Commit

Permalink
PointLockManager::UnLockKey: use swap instead of check
Browse files Browse the repository at this point in the history
  • Loading branch information
rockeet committed Jun 25, 2022
1 parent 9f2091f commit 9d8106d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions utilities/transactions/lock/point/point_lock_manager.cc
Expand Up @@ -587,10 +587,7 @@ void PointLockManager::UnLockKey(PessimisticTransaction* txn,
if (txns.size() == 1) {
stripe->keys.erase(stripe_iter);
} else {
auto last_it = txns.end() - 1;
if (txn_it != last_it) {
*txn_it = *last_it;
}
std::swap(txns.back(), *txn_it);
txns.pop_back();
}

Expand Down

0 comments on commit 9d8106d

Please sign in to comment.