refactor Hashtable
This commit is contained in:
@@ -49,7 +49,7 @@ struct ExtractionWay {
|
||||
id = UINT_MAX;
|
||||
nameID = UINT_MAX;
|
||||
path.clear();
|
||||
keyVals.EraseAll();
|
||||
keyVals.clear();
|
||||
direction = ExtractionWay::notSure;
|
||||
speed = -1;
|
||||
backward_speed = -1;
|
||||
|
||||
@@ -177,7 +177,7 @@ inline void PBFParser::parseDenseNode(_ThreadData * threadData) {
|
||||
const int keyValue = dense.keys_vals ( denseTagIndex+1 );
|
||||
const std::string & key = threadData->PBFprimitiveBlock.stringtable().s(tagValue).data();
|
||||
const std::string & value = threadData->PBFprimitiveBlock.stringtable().s(keyValue).data();
|
||||
extracted_nodes_vector[i].keyVals.Add(key, value);
|
||||
extracted_nodes_vector[i].keyVals.insert(std::make_pair(key, value));
|
||||
denseTagIndex += 2;
|
||||
}
|
||||
}
|
||||
@@ -306,7 +306,7 @@ inline void PBFParser::parseWay(_ThreadData * threadData) {
|
||||
for(int j = 0; j < number_of_keys; ++j) {
|
||||
const std::string & key = threadData->PBFprimitiveBlock.stringtable().s(inputWay.keys(j));
|
||||
const std::string & val = threadData->PBFprimitiveBlock.stringtable().s(inputWay.vals(j));
|
||||
parsed_way_vector[i].keyVals.Add(key, val);
|
||||
parsed_way_vector[i].keyVals.insert(std::make_pair(key, val));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,9 @@ ScriptingEnvironment::ScriptingEnvironment(const char * fileName) {
|
||||
INFO("Using script " << fileName);
|
||||
|
||||
// Create a new lua state
|
||||
for(int i = 0; i < omp_get_max_threads(); ++i)
|
||||
for(int i = 0; i < omp_get_max_threads(); ++i) {
|
||||
luaStateVector.push_back(luaL_newstate());
|
||||
}
|
||||
|
||||
// Connect LuaBind to this lua state for all threads
|
||||
#pragma omp parallel
|
||||
@@ -85,6 +86,7 @@ ScriptingEnvironment::ScriptingEnvironment(const char * fileName) {
|
||||
luabind::value("opposite", 3)
|
||||
]
|
||||
];
|
||||
|
||||
luabind::module(myLuaState) [
|
||||
luabind::class_<std::vector<std::string> >("vector")
|
||||
.def("Add", &std::vector<std::string>::push_back)
|
||||
|
||||
Reference in New Issue
Block a user