DRTVWR-564: Per NickyD, need not test static_cast result for nullptr.

meow-7.2.2
Nat Goodspeed 2022-06-21 17:24:03 -04:00
parent fa3a67f56b
commit f9d810ac2a
2 changed files with 1 additions and 16 deletions

View File

@ -586,13 +586,6 @@ void LLEventDispatcher::add(const std::string& name, const std::string& desc,
new LLSDDispatchEntry(desc, callable, required))));
}
void LLEventDispatcher::addFail(const std::string& name, const std::string& classname) const
{
LL_ERRS("LLEventDispatcher") << "LLEventDispatcher(" << mDesc << ")::add(" << name
<< "): " << classname << " is not a subclass "
<< "of LLEventDispatcher" << LL_ENDL;
}
/// Unregister a callable
bool LLEventDispatcher::remove(const std::string& name)
{

View File

@ -330,16 +330,8 @@ private:
const METHOD& method, const LLSD& required)
{
CLASS* downcast = static_cast<CLASS*>(this);
if (! downcast)
{
addFail(name, typeid(CLASS).name());
}
else
{
add(name, desc, boost::bind(method, downcast, _1), required);
}
add(name, desc, boost::bind(method, downcast, _1), required);
}
void addFail(const std::string& name, const std::string& classname) const;
std::string try_call_log(const std::string& key, const std::string& name,
const LLSD& event) const;
std::string try_call(const std::string& key, const std::string& name,