diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game-server/idmanager.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/game-server/idmanager.h b/src/game-server/idmanager.h index 57828af8..2b606975 100644 --- a/src/game-server/idmanager.h +++ b/src/game-server/idmanager.h @@ -53,7 +53,7 @@ inline unsigned IdManager<Value>::allocate(Value *t) ++mLastId; } while (mIdMap.find(mLastId) != mIdMap.end()); - mIdMap.insert(std::make_pair(mLastId, t)); + mIdMap.emplace(mLastId, t); return mLastId; } @@ -67,9 +67,7 @@ template <typename Value> inline Value *IdManager<Value>::find(unsigned id) const { auto it = mIdMap.find(id); - if (it != mIdMap.end()) - return it->second; - return nullptr; + return it != mIdMap.end() ? it->second : nullptr; } #endif // IDMANAGER_H |