Remove unused assert warnings when building Release

This commit is contained in:
pixl 2020-07-15 13:27:21 -04:00
parent 9b3183c791
commit f51ba0f681
No known key found for this signature in database
GPG Key ID: 1866C148CD593B6E
3 changed files with 4 additions and 8 deletions

View File

@ -267,8 +267,7 @@ void Receiver::_handleHidppEvent(hidpp::Report &report)
void Receiver::addDjEventHandler(const std::string& nickname, void Receiver::addDjEventHandler(const std::string& nickname,
const std::shared_ptr<EventHandler>& handler) const std::shared_ptr<EventHandler>& handler)
{ {
auto it = _dj_event_handlers.find(nickname); assert(_dj_event_handlers.find(nickname) == _dj_event_handlers.end());
assert(it == _dj_event_handlers.end());
_dj_event_handlers.emplace(nickname, handler); _dj_event_handlers.emplace(nickname, handler);
} }
@ -286,8 +285,7 @@ Receiver::djEventHandlers()
void Receiver::addHidppEventHandler(const std::string& nickname, void Receiver::addHidppEventHandler(const std::string& nickname,
const std::shared_ptr<hidpp::EventHandler>& handler) const std::shared_ptr<hidpp::EventHandler>& handler)
{ {
auto it = _hidpp_event_handlers.find(nickname); assert(_hidpp_event_handlers.find(nickname) == _hidpp_event_handlers.end());
assert(it == _hidpp_event_handlers.end());
_hidpp_event_handlers.emplace(nickname, handler); _hidpp_event_handlers.emplace(nickname, handler);
} }

View File

@ -138,8 +138,7 @@ Device::~Device()
void Device::addEventHandler(const std::string& nickname, void Device::addEventHandler(const std::string& nickname,
const std::shared_ptr<EventHandler>& handler) const std::shared_ptr<EventHandler>& handler)
{ {
auto it = _event_handlers.find(nickname); assert(_event_handlers.find(nickname) == _event_handlers.end());
assert(it == _event_handlers.end());
_event_handlers.emplace(nickname, handler); _event_handlers.emplace(nickname, handler);
} }

View File

@ -459,8 +459,7 @@ void RawDevice::addEventHandler(const std::string& nickname,
const std::shared_ptr<raw::RawEventHandler>& handler) const std::shared_ptr<raw::RawEventHandler>& handler)
{ {
std::unique_lock<std::mutex> lock(_event_handler_lock); std::unique_lock<std::mutex> lock(_event_handler_lock);
auto it = _event_handlers.find(nickname); assert(_event_handlers.find(nickname) == _event_handlers.end());
assert(it == _event_handlers.end());
assert(handler); assert(handler);
_event_handlers.emplace(nickname, handler); _event_handlers.emplace(nickname, handler);
} }