Legacy cleanup, part 2 (#3659)
* Legacy cleanup, part 2 There are still things that can be removed, those will be likely done in part three: `The Return of the Cleanup` :) Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Fix windows build Somehow there were some unfixed errors from enabled warnings? I'm unsure if I've pulled repo in unstable state, or those were somehow missed. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
This commit is contained in:
@@ -129,40 +129,6 @@ uint64 CXConsoleVariableBase::AddOnChangeFunctor(const SFunctor& pChangeFunctor)
|
||||
return newId;
|
||||
}
|
||||
|
||||
uint64 CXConsoleVariableBase::GetNumberOfOnChangeFunctors() const
|
||||
{
|
||||
return m_changeFunctors.size();
|
||||
}
|
||||
|
||||
const SFunctor& CXConsoleVariableBase::GetOnChangeFunctor(uint64 nFunctorId) const
|
||||
{
|
||||
auto predicate = [nFunctorId](const std::pair<int, SFunctor>& entry) -> bool { return entry.first == nFunctorId; };
|
||||
auto changeFunctor = std::find_if(m_changeFunctors.begin(), m_changeFunctors.end(), predicate);
|
||||
if (changeFunctor != m_changeFunctors.end())
|
||||
{
|
||||
return (*changeFunctor).second;
|
||||
}
|
||||
|
||||
static SFunctor sDummyFunctor;
|
||||
assert(false && "[CXConsoleVariableBase::GetOnChangeFunctor] Trying to get a functor for an id that does not exist.");
|
||||
|
||||
return sDummyFunctor;
|
||||
}
|
||||
|
||||
bool CXConsoleVariableBase::RemoveOnChangeFunctor(const uint64 nFunctorId)
|
||||
{
|
||||
auto predicate = [nFunctorId](const std::pair<int, SFunctor>& entry) -> bool { return entry.first == nFunctorId; };
|
||||
auto changeFunctor = std::find_if(m_changeFunctors.begin(), m_changeFunctors.end(), predicate);
|
||||
|
||||
if (changeFunctor != m_changeFunctors.end())
|
||||
{
|
||||
m_changeFunctors.erase(changeFunctor);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
ConsoleVarFunc CXConsoleVariableBase::GetOnChangeCallback() const
|
||||
{
|
||||
return m_pChangeFunc;
|
||||
|
||||
Reference in New Issue
Block a user