diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-25 16:41:44 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-25 16:41:44 -0700 |
commit | 28b30ff302ed535b1e81902f06d24c9e9fe61c19 (patch) | |
tree | 80887a7f8fa0c602ccb6c88257dc6b41bf51e2b1 /src/cstore/unionfs/cstore-unionfs.cpp | |
parent | 17e3a880453dc220e5a235df1e21dabfa89f1e8e (diff) | |
download | vyatta-cfg-28b30ff302ed535b1e81902f06d24c9e9fe61c19.tar.gz vyatta-cfg-28b30ff302ed535b1e81902f06d24c9e9fe61c19.zip |
switch to unordered_map
Diffstat (limited to 'src/cstore/unionfs/cstore-unionfs.cpp')
-rw-r--r-- | src/cstore/unionfs/cstore-unionfs.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp index 5cfd8ee..849d659 100644 --- a/src/cstore/unionfs/cstore-unionfs.cpp +++ b/src/cstore/unionfs/cstore-unionfs.cpp @@ -17,7 +17,6 @@ #include <cstdio> #include <cstdlib> #include <cstring> -#include <map> #include <fstream> #include <sstream> @@ -63,8 +62,8 @@ const string UnionfsCstore::C_DEF_NAME = "node.def"; ////// static -static map<char, string> _fs_escape_chars; -static map<string, char> _fs_unescape_chars; +static Cstore::MapT<char, string> _fs_escape_chars; +static Cstore::MapT<string, char> _fs_unescape_chars; static void _init_fs_escape_chars() { @@ -80,7 +79,7 @@ _init_fs_escape_chars() static string _escape_char(char c) { - map<char, string>::iterator p = _fs_escape_chars.find(c); + Cstore::MapT<char, string>::iterator p = _fs_escape_chars.find(c); if (p != _fs_escape_chars.end()) { return _fs_escape_chars[c]; } else { @@ -88,12 +87,13 @@ _escape_char(char c) } } -static map<string, string> _escape_path_name_cache; +static Cstore::MapT<string, string> _escape_path_name_cache; static string _escape_path_name(const string& path) { - map<string, string>::iterator p = _escape_path_name_cache.find(path); + Cstore::MapT<string, string>::iterator p + = _escape_path_name_cache.find(path); if (p != _escape_path_name_cache.end()) { // found escaped string in cache. just return it. return _escape_path_name_cache[path]; @@ -110,12 +110,13 @@ _escape_path_name(const string& path) return npath; } -static map<string, string> _unescape_path_name_cache; +static Cstore::MapT<string, string> _unescape_path_name_cache; static string _unescape_path_name(const string& path) { - map<string, string>::iterator p = _unescape_path_name_cache.find(path); + Cstore::MapT<string, string>::iterator p + = _unescape_path_name_cache.find(path); if (p != _unescape_path_name_cache.end()) { // found unescaped string in cache. just return it. return _unescape_path_name_cache[path]; @@ -129,7 +130,7 @@ _unescape_path_name(const string& path) break; } string s = path.substr(i, 3); - map<string, char>::iterator p = _fs_unescape_chars.find(s); + Cstore::MapT<string, char>::iterator p = _fs_unescape_chars.find(s); if (p != _fs_unescape_chars.end()) { char c = _fs_unescape_chars[s]; if (path.size() == 3 && c == -1) { |