Skip to content

Commit

Permalink
Replaced trivial find_ifs with find.
Browse files Browse the repository at this point in the history
  • Loading branch information
afritz1 committed Apr 13, 2018
1 parent 4611ce8 commit 3d8ba9f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
6 changes: 1 addition & 5 deletions world/LevelFuncMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ void LevelFuncMgr::DestroyLevelFunc(LevelFunc *pFunc)

RemoveFromActiveList(pFunc);

const auto iter = std::find_if(m_FuncList.begin(), m_FuncList.end(),
[pFunc](const LevelFunc *levelFunc)
{
return levelFunc == pFunc;
});
const auto iter = std::find(m_FuncList.begin(), m_FuncList.end(), pFunc);

if (iter != m_FuncList.end())
{
Expand Down
6 changes: 1 addition & 5 deletions world/ObjectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,7 @@ void ObjectManager::FreeObject(Object *pObj)
m_FreeObjects.push_back( pObj );

//remove this from the active object list.
const auto iter = std::find_if(m_ActiveObjects.begin(), m_ActiveObjects.end(),
[pObj](const Object *activeObj)
{
return activeObj == pObj;
});
const auto iter = std::find(m_ActiveObjects.begin(), m_ActiveObjects.end(), pObj);

if (iter != m_ActiveObjects.end())
{
Expand Down
6 changes: 1 addition & 5 deletions world/Sector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ void Sector::AddObject(uint32_t uHandle)
void Sector::RemoveObject(uint32_t uHandle)
{
//search for object handle and then erase it.
const auto iter = std::find_if(m_Objects.begin(), m_Objects.end(),
[uHandle](const uint32_t objID)
{
return objID == uHandle;
});
const auto iter = std::find(m_Objects.begin(), m_Objects.end(), uHandle);

if (iter != m_Objects.end())
{
Expand Down
6 changes: 1 addition & 5 deletions world/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ bool World::AddWorldCell(WorldCell *pCell)

void World::RemoveWorldCell(WorldCell *pCell)
{
const auto iter = std::find_if(m_WorldCells.begin(), m_WorldCells.end(),
[pCell](const WorldCell *worldCell)
{
return worldCell == pCell;
});
const auto iter = std::find(m_WorldCells.begin(), m_WorldCells.end(), pCell);

if (iter != m_WorldCells.end())
{
Expand Down

0 comments on commit 3d8ba9f

Please sign in to comment.