Skip to content

Commit

Permalink
Fix clang-tidy warnings in LockHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Mar 1, 2025
1 parent 059843b commit 933c7a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/core/include/mrpt/core/lock_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LockHelper
using Tnc = std::remove_const_t<T>;

public:
LockHelper(const Tnc* l) : l_{const_cast<Tnc*>(l)} { l_->lock(); }
explicit LockHelper(const Tnc* l) : l_{const_cast<Tnc*>(l)} { l_->lock(); }
~LockHelper()
{
if (l_) l_->unlock();
Expand All @@ -31,11 +31,11 @@ class LockHelper
LockHelper(const LockHelper& o) = delete;
LockHelper& operator=(const LockHelper& o) = delete;

LockHelper(LockHelper&& o) : l_{o.l} { o.l = nullptr; }
LockHelper(LockHelper&& o) : l_{o.l_} { o.l_ = nullptr; }
LockHelper& operator=(LockHelper&& o)
{
l_ = o.l;
o.l = nullptr;
l_ = o.l_;
o.l_ = nullptr;
return *this;
}

Expand Down

0 comments on commit 933c7a2

Please sign in to comment.