summaryrefslogtreecommitdiff
path: root/runtime/safe_map.h
diff options
context:
space:
mode:
author Jeff Hao <jeffhao@google.com> 2015-09-18 22:58:22 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-09-18 22:58:22 +0000
commit9e30c0e177adabaaf94a66c91130a19a7632fc7c (patch)
treee3177c7686cb6203c5f4c91cb9a38b6e80fcbec0 /runtime/safe_map.h
parent8e7b964be2fab9b6bbb30cf8897617424d0fe85f (diff)
parent4686c52394c0221ee3236753ad6be48f18b79365 (diff)
Merge "Fix locking on string init map."
Diffstat (limited to 'runtime/safe_map.h')
-rw-r--r--runtime/safe_map.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/safe_map.h b/runtime/safe_map.h
index 402c7e9cb5..04549c7889 100644
--- a/runtime/safe_map.h
+++ b/runtime/safe_map.h
@@ -104,12 +104,13 @@ class SafeMap {
// Used to insert a new mapping or overwrite an existing mapping. Note that if the value type
// of this container is a pointer, any overwritten pointer will be lost and if this container
// was the owner, you have a leak.
- void Overwrite(const K& k, const V& v) {
+ iterator Overwrite(const K& k, const V& v) {
std::pair<iterator, bool> result = map_.insert(std::make_pair(k, v));
if (!result.second) {
// Already there - update the value for the existing key
result.first->second = v;
}
+ return result.first;
}
bool Equals(const Self& rhs) const {