Switch from std::map<> to std::unordered_map<> where possible

Didn't switch env_var_t map because it seems to be mostly iterated in
order, but that decision may be revisited at a later date.
This commit is contained in:
Mahmoud Al-Qudsi
2017-08-19 11:55:06 -05:00
parent 0dce9a2114
commit 61b4900a70
12 changed files with 45 additions and 28 deletions

View File

@@ -17,8 +17,8 @@
#include <wchar.h>
#include <wctype.h>
#include <map>
#include <string>
#include <unordered_map>
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
@@ -38,7 +38,7 @@ const file_id_t kInvalidFileID = {(dev_t)-1LL, (ino_t)-1LL, (uint64_t)-1LL, -1,
#endif
/// Map used as cache by wgettext.
static owning_lock<std::map<wcstring, wcstring>> wgettext_map;
static owning_lock<std::unordered_map<wcstring, wcstring>> wgettext_map;
bool wreaddir_resolving(DIR *dir, const wcstring &dir_path, wcstring &out_name, bool *out_is_dir) {
struct dirent d;