Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Unified Diff: snapshot/minidump/minidump_simple_string_dictionary_reader.cc

Issue 1044273002: Improve map insertions (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/mac/mach_o_image_symbol_table_reader.cc ('k') | snapshot/minidump/process_snapshot_minidump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/minidump/minidump_simple_string_dictionary_reader.cc
diff --git a/snapshot/minidump/minidump_simple_string_dictionary_reader.cc b/snapshot/minidump/minidump_simple_string_dictionary_reader.cc
index 085c1f60dec33fe385b4a7bff4913de7f8f891a7..0d8301c1b300c1e6ce94b21491802f495faa5149 100644
--- a/snapshot/minidump/minidump_simple_string_dictionary_reader.cc
+++ b/snapshot/minidump/minidump_simple_string_dictionary_reader.cc
@@ -72,12 +72,10 @@ bool ReadMinidumpSimpleStringDictionary(
return false;
}
- if (local_dictionary.find(key) != local_dictionary.end()) {
- LOG(WARNING) << "duplicate key " << key << ", discarding value " << value;
+ if (!local_dictionary.insert(std::make_pair(key, value)).second) {
+ LOG(ERROR) << "duplicate key " << key;
scottmg 2015/03/31 18:16:15 log level change was intentional?
Mark Mentovai 2015/03/31 18:21:32 scottmg wrote:
return false;
}
-
- local_dictionary.insert(std::make_pair(key, value));
}
dictionary->swap(local_dictionary);
« no previous file with comments | « snapshot/mac/mach_o_image_symbol_table_reader.cc ('k') | snapshot/minidump/process_snapshot_minidump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698