mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use class template argument deduction for locks
This commit is contained in:
@@ -52,7 +52,7 @@ PeerReservationTable::list() const -> std::vector<PeerReservation>
|
||||
{
|
||||
std::vector<PeerReservation> list;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard lock(mutex_);
|
||||
list.reserve(table_.size());
|
||||
std::copy(table_.begin(), table_.end(), std::back_inserter(list));
|
||||
}
|
||||
@@ -69,7 +69,7 @@ PeerReservationTable::list() const -> std::vector<PeerReservation>
|
||||
bool
|
||||
PeerReservationTable::load(DatabaseCon& connection)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard lock(mutex_);
|
||||
|
||||
connection_ = &connection;
|
||||
auto db = connection_->checkoutDb();
|
||||
@@ -111,7 +111,7 @@ PeerReservationTable::insert_or_assign(
|
||||
{
|
||||
boost::optional<PeerReservation> previous;
|
||||
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard lock(mutex_);
|
||||
|
||||
auto hint = table_.find(reservation);
|
||||
if (hint != table_.end()) {
|
||||
@@ -150,7 +150,7 @@ PeerReservationTable::erase(PublicKey const& nodeId)
|
||||
{
|
||||
boost::optional<PeerReservation> previous;
|
||||
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard lock(mutex_);
|
||||
|
||||
auto const it = table_.find({nodeId});
|
||||
if (it != table_.end())
|
||||
|
||||
Reference in New Issue
Block a user