mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-17 17:08:39 +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
|
@ -21,14 +21,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#define ITEMGROUP_HEADER
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "util/cpp11_container.h"
|
||||
|
||||
typedef std::map<std::string, int> ItemGroupList;
|
||||
typedef UNORDERED_MAP<std::string, int> ItemGroupList;
|
||||
|
||||
static inline int itemgroup_get(const ItemGroupList &groups,
|
||||
const std::string &name)
|
||||
{
|
||||
std::map<std::string, int>::const_iterator i = groups.find(name);
|
||||
ItemGroupList::const_iterator i = groups.find(name);
|
||||
if(i == groups.end())
|
||||
return 0;
|
||||
return i->second;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue