diff options
| author | Léo Lam <leo@leolam.fr> | 2022-03-05 19:09:32 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2022-03-05 19:13:06 +0100 |
| commit | 88a0a9eb691a3c1925e9b5d185fb12550618e5f8 (patch) | |
| tree | ec055bc9747a1c01d45231eadc204858af39422f /src/KingSystem/ActorSystem | |
| parent | d839816081398859f95668e2c5aad872d24919f0 (diff) | |
Use sead::OffsetList::robustRange() when possible to simplify iteration
Diffstat (limited to 'src/KingSystem/ActorSystem')
| -rw-r--r-- | src/KingSystem/ActorSystem/actBaseProcMgr.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/KingSystem/ActorSystem/actBaseProcMgr.cpp b/src/KingSystem/ActorSystem/actBaseProcMgr.cpp index ecf03b66..9c8c59be 100644 --- a/src/KingSystem/ActorSystem/actBaseProcMgr.cpp +++ b/src/KingSystem/ActorSystem/actBaseProcMgr.cpp @@ -310,11 +310,10 @@ void BaseProcMgr::calc() { for (auto& proc : mProcUpdateStateList) proc.processStateUpdate(mCounter); - for (auto it = mProcUpdateStateList.robustBegin(), end = mProcUpdateStateList.robustEnd(); - it != end; ++it) { - it->afterUpdateState_(); - if (it->mStateFlags.isZero()) { - mProcUpdateStateList.erase(std::addressof(*it)); + for (auto& proc : mProcUpdateStateList.robustRange()) { + proc.afterUpdateState_(); + if (proc.mStateFlags.isZero()) { + mProcUpdateStateList.erase(&proc); } } |
