fixes add entry issue
This commit is contained in:
parent
32721d951f
commit
318681e276
|
@ -27,8 +27,13 @@ namespace traffic_manager {
|
|||
void AddEntry(const std::pair<Key, Value> &entry) {
|
||||
|
||||
std::lock_guard<std::mutex> lock(map_mutex);
|
||||
const Key& key = entry.first;
|
||||
if (map.find(key) != map.end()) {
|
||||
map.at(key) = entry.second;
|
||||
} else {
|
||||
map.insert(entry);
|
||||
}
|
||||
}
|
||||
|
||||
bool Contains(const Key &key) const {
|
||||
|
||||
|
|
Loading…
Reference in New Issue