make doc.meta an unordered_map
This commit is contained in:
+10
-5
@@ -37,6 +37,8 @@
|
||||
#include "safesysstat.h"
|
||||
|
||||
#include <mutex>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "rclutil.h"
|
||||
#include "pathut.h"
|
||||
@@ -49,15 +51,18 @@
|
||||
using namespace std;
|
||||
|
||||
|
||||
void map_ss_cp_noshr(const map<string, string> s, map<string, string> *d)
|
||||
template <class T> void map_ss_cp_noshr(T s, T *d)
|
||||
{
|
||||
for (map<string, string>::const_iterator it = s.begin();
|
||||
it != s.end(); it++) {
|
||||
for (const auto& ent : s) {
|
||||
d->insert(
|
||||
pair<string, string>(string(it->first.begin(), it->first.end()),
|
||||
string(it->second.begin(), it->second.end())));
|
||||
pair<string, string>(string(ent.first.begin(), ent.first.end()),
|
||||
string(ent.second.begin(), ent.second.end())));
|
||||
}
|
||||
}
|
||||
template void map_ss_cp_noshr<map<string, string> >(
|
||||
map<string, string> s, map<string, string>*d);
|
||||
template void map_ss_cp_noshr<unordered_map<string, string> >(
|
||||
unordered_map<string,string> s, unordered_map<string,string>*d);
|
||||
|
||||
#ifdef _WIN32
|
||||
static bool path_hasdrive(const string& s)
|
||||
|
||||
+3
-4
@@ -94,10 +94,9 @@ private:
|
||||
extern bool thumbPathForUrl(const std::string& url, int size,
|
||||
std::string& path);
|
||||
|
||||
// Duplicate map<string,string> while ensuring no shared string data (to pass
|
||||
// to other thread):
|
||||
void map_ss_cp_noshr(const std::map<std::string, std::string> s,
|
||||
std::map<std::string, std::string> *d);
|
||||
// Duplicate (unordered)map<string,string> while ensuring no shared
|
||||
// string data (to pass to other thread):
|
||||
template <class T> void map_ss_cp_noshr(T s, T *d);
|
||||
|
||||
|
||||
#endif /* _RCLUTIL_H_INCLUDED_ */
|
||||
|
||||
Reference in New Issue
Block a user