1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Replace various std::map with UNORDERED_MAP + various cleanups

This is part 2 for 5f084cd98d

Other improvements:

* Use the defined ItemGroupList when used
* make Client::checkPrivilege const
* inline some trivial functions
* Add ActiveObjectMap typedef
* Add SettingsEntries typedef
This commit is contained in:
Loic Blot 2016-10-05 09:03:55 +02:00 committed by Ner'zhul
parent 5f084cd98d
commit 613797a304
23 changed files with 110 additions and 167 deletions

View file

@ -462,7 +462,7 @@ public:
u16 getHP();
u16 getBreath();
bool checkPrivilege(const std::string &priv)
bool checkPrivilege(const std::string &priv) const
{ return (m_privileges.count(priv) != 0); }
bool getChatMessage(std::wstring &message);
@ -670,11 +670,11 @@ private:
std::map<int, u16> m_sounds_to_objects;
// Privileges
std::set<std::string> m_privileges;
UNORDERED_SET<std::string> m_privileges;
// Detached inventories
// key = name
std::map<std::string, Inventory*> m_detached_inventories;
UNORDERED_MAP<std::string, Inventory*> m_detached_inventories;
// Storage for mesh data for creating multiple instances of the same mesh
StringMap m_mesh_data;