summaryrefslogtreecommitdiff
path: root/src/cstore/unionfs
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-08-25 16:41:44 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2010-08-25 16:41:44 -0700
commit28b30ff302ed535b1e81902f06d24c9e9fe61c19 (patch)
tree80887a7f8fa0c602ccb6c88257dc6b41bf51e2b1 /src/cstore/unionfs
parent17e3a880453dc220e5a235df1e21dabfa89f1e8e (diff)
downloadvyatta-cfg-28b30ff302ed535b1e81902f06d24c9e9fe61c19.tar.gz
vyatta-cfg-28b30ff302ed535b1e81902f06d24c9e9fe61c19.zip
switch to unordered_map
Diffstat (limited to 'src/cstore/unionfs')
-rw-r--r--src/cstore/unionfs/cstore-unionfs.cpp19
-rw-r--r--src/cstore/unionfs/cstore-unionfs.hpp4
2 files changed, 12 insertions, 11 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) {
diff --git a/src/cstore/unionfs/cstore-unionfs.hpp b/src/cstore/unionfs/cstore-unionfs.hpp
index 90f28c5..3942e01 100644
--- a/src/cstore/unionfs/cstore-unionfs.hpp
+++ b/src/cstore/unionfs/cstore-unionfs.hpp
@@ -83,7 +83,7 @@ private:
// path buffers
b_fs::path mutable_cfg_path; // mutable part of config path
b_fs::path tmpl_path; // whole template path
- map<const void *, pair<b_fs::path, b_fs::path> > saved_paths;
+ Cstore::MapT<const void *, pair<b_fs::path, b_fs::path> > saved_paths;
// saved mutable part of cfg path and whole template path
////// virtual functions defined in base class
@@ -122,7 +122,7 @@ private:
saved_paths[handle] = p;
};
void restore_paths(const void *handle = NULL) {
- map<const void *, pair<b_fs::path, b_fs::path> >::iterator it
+ Cstore::MapT<const void *, pair<b_fs::path, b_fs::path> >::iterator it
= saved_paths.find(handle);
if (it == saved_paths.end()) {
exit_internal("restore_paths: handle not found\n");