diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2012-08-23 13:42:58 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:42:21 +0300 |
commit | bd1102592a7926ca070b4f191980db78b6b9e52b (patch) | |
tree | 281cb3bca9495667031b99334d317a4f1ee4767c /anim | |
parent | 0ba56f8945461a8a64d6031b6138ec1c42250a3c (diff) |
fixes according to code review.
Diffstat (limited to 'anim')
-rw-r--r-- | anim/controller.cpp | 11 | ||||
-rw-r--r-- | anim/controller.hpp | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/anim/controller.cpp b/anim/controller.cpp index 3e347cd4d8..9e246da4c2 100644 --- a/anim/controller.cpp +++ b/anim/controller.cpp @@ -1,6 +1,7 @@ #include "controller.hpp" #include "task.hpp" +#include "../base/assert.hpp" #include "../base/timer.hpp" #include "../std/bind.hpp" @@ -20,7 +21,7 @@ namespace anim m_tasks.PushBack(task); } - void Controller::CopyTasks(TTasks & from, TTasks & to) + void Controller::CopyAndClearTasks(TTasks & from, TTasks & to) { to.clear(); swap(from, to); @@ -43,15 +44,13 @@ namespace anim int Controller::LockCount() { - if (m_LockCount < 0) - LOG(LWARNING, ("Lock/Unlock is unbalanced! LockCount < 0!")); - + ASSERT(m_LockCount >=0, ("Lock/Unlock is unbalanced! LockCount < 0!")); return m_LockCount; } void Controller::PerformStep() { - m_tasks.ProcessList(bind(&Controller::CopyTasks, this, _1, ref(m_tasksList))); + m_tasks.ProcessList(bind(&Controller::CopyAndClearTasks, _1, ref(m_tasksList))); double ts = my::Timer::LocalTime(); @@ -76,6 +75,6 @@ namespace anim } } - m_tasks.ProcessList(bind(&Controller::CopyTasks, this, ref(l), _1)); + m_tasks.ProcessList(bind(&Controller::CopyAndClearTasks, ref(l), _1)); } } diff --git a/anim/controller.hpp b/anim/controller.hpp index a46c9032c9..b93b19b71e 100644 --- a/anim/controller.hpp +++ b/anim/controller.hpp @@ -23,7 +23,7 @@ namespace anim int m_LockCount; - void CopyTasks(list<shared_ptr<Task> > & from, list<shared_ptr<Task> > & to); + static void CopyAndClearTasks(list<shared_ptr<Task> > & from, list<shared_ptr<Task> > & to); public: // Constructor |