Hashtable does not allocate during operator[], RouteParameters to

plugins are passed as ref and not as value.
This commit is contained in:
DennisOSRM
2011-12-28 14:14:09 +01:00
parent 738c3eae91
commit 5c10d2fae0
6 changed files with 10 additions and 9 deletions
+5 -4
View File
@@ -42,7 +42,7 @@ public:
void Set(const keyT& key, const valueT& value){
table[key] = value;
}
valueT Find(const keyT& key) {
valueT Find(const keyT& key) const {
if(table.find(key) == table.end())
return valueT();
return table.find(key)->second;
@@ -58,9 +58,10 @@ public:
table.clear();
}
inline
valueT & operator[] (keyT key) {
return table[key];
inline valueT operator[] (keyT key) const {
if(table.find(key) == table.end())
return valueT();
return table.find(key)->second;
}
unsigned Size() const {
return table.size();