Skip to content

Commit

Permalink
Remove unnecessary mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Dec 17, 2024
1 parent 519a70f commit 4ee1227
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cpp/include/DataStorm/InternalT.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,20 +437,18 @@ namespace DataStormI

const std::string& getName() const final { return _name; }

template<typename FF> void init(const std::string& name, FF&& lambda)
template<typename FF> void init(std::string name, FF lambda)
{
std::unique_lock lock(_mutex);
if (!_lambda)
{
_name = name;
_lambda = std::forward<FF>(lambda);
_name = std::move(name);
_lambda = std::move(lambda);
}
}

using BaseClassType = Filter;

private:
std::mutex _mutex;
std::string _name;
std::function<bool(const typename std::remove_reference<decltype(std::declval<V>().get())>::type&)> _lambda;
};
Expand Down

0 comments on commit 4ee1227

Please sign in to comment.