mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +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:
parent
5f084cd98d
commit
613797a304
23 changed files with 110 additions and 167 deletions
|
@ -25,10 +25,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "serialization.h" // for SER_FMT_VER_INVALID
|
||||
#include "threading/mutex.h"
|
||||
#include "network/networkpacket.h"
|
||||
#include "util/cpp11_container.h"
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
class MapBlock;
|
||||
|
@ -502,8 +502,7 @@ protected:
|
|||
void lock() { m_clients_mutex.lock(); }
|
||||
void unlock() { m_clients_mutex.unlock(); }
|
||||
|
||||
std::map<u16, RemoteClient*>& getClientList()
|
||||
{ return m_clients; }
|
||||
UNORDERED_MAP<u16, RemoteClient*>& getClientList() { return m_clients; }
|
||||
|
||||
private:
|
||||
/* update internal player list */
|
||||
|
@ -513,7 +512,7 @@ private:
|
|||
con::Connection* m_con;
|
||||
Mutex m_clients_mutex;
|
||||
// Connected clients (behind the con mutex)
|
||||
std::map<u16, RemoteClient*> m_clients;
|
||||
UNORDERED_MAP<u16, RemoteClient*> m_clients;
|
||||
std::vector<std::string> m_clients_names; //for announcing masterserver
|
||||
|
||||
// Environment
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue