summaryrefslogtreecommitdiff
path: root/src/environment.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2016-10-05 09:03:55 +0200
committerNer'zhul <nerzhul@users.noreply.github.com>2016-10-05 10:53:19 +0200
commit613797a3048907275ceebe29582b9fc2761b1f25 (patch)
tree1d8f90a75c86dd3a32a72d3789bc108042d8f65d /src/environment.h
parent5f084cd98d7b3326b51320455364337539710efd (diff)
downloadminetest-613797a3048907275ceebe29582b9fc2761b1f25.tar.gz
minetest-613797a3048907275ceebe29582b9fc2761b1f25.tar.bz2
minetest-613797a3048907275ceebe29582b9fc2761b1f25.zip
Replace various std::map with UNORDERED_MAP + various cleanups
This is part 2 for 5f084cd98d7b3326b51320455364337539710efd Other improvements: * Use the defined ItemGroupList when used * make Client::checkPrivilege const * inline some trivial functions * Add ActiveObjectMap typedef * Add SettingsEntries typedef
Diffstat (limited to 'src/environment.h')
-rw-r--r--src/environment.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/environment.h b/src/environment.h
index c6786faed..1ba7b196f 100644
--- a/src/environment.h
+++ b/src/environment.h
@@ -300,6 +300,8 @@ enum ClearObjectsMode {
This is not thread-safe. Server uses an environment mutex.
*/
+typedef UNORDERED_MAP<u16, ServerActiveObject *> ActiveObjectMap;
+
class ServerEnvironment : public Environment
{
public:
@@ -338,7 +340,7 @@ public:
void loadDefaultMeta();
u32 addParticleSpawner(float exptime);
- void deleteParticleSpawner(u32 id);
+ void deleteParticleSpawner(u32 id) { m_particle_spawners.erase(id); }
/*
External ActiveObject interface
@@ -491,7 +493,7 @@ private:
// World path
const std::string m_path_world;
// Active object list
- std::map<u16, ServerActiveObject*> m_active_objects;
+ ActiveObjectMap m_active_objects;
// Outgoing network message buffer for active objects
std::queue<ActiveObjectMessage> m_active_object_messages;
// Some timers
@@ -522,7 +524,7 @@ private:
// Particles
IntervalLimiter m_particle_management_interval;
- std::map<u32, float> m_particle_spawners;
+ UNORDERED_MAP<u32, float> m_particle_spawners;
};
#ifndef SERVER