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

Unified Diff: snapshot/minidump/process_snapshot_minidump.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
Index: snapshot/minidump/process_snapshot_minidump.cc
diff --git a/snapshot/minidump/process_snapshot_minidump.cc b/snapshot/minidump/process_snapshot_minidump.cc
index 256e429ecd2bbcd2cdea5df5b8918e410fd8eb7b..fa87981b5c2437e87d923f15bd53081c863c0381 100644
--- a/snapshot/minidump/process_snapshot_minidump.cc
+++ b/snapshot/minidump/process_snapshot_minidump.cc
@@ -309,16 +309,13 @@ bool ProcessSnapshotMinidump::InitializeModulesCrashpadInfo(
++crashpad_module_index) {
const MinidumpModuleCrashpadInfoLink& minidump_link =
minidump_links[crashpad_module_index];
- if (module_crashpad_info_links->find(
- minidump_link.minidump_module_list_index) !=
- module_crashpad_info_links->end()) {
+ if (!module_crashpad_info_links
+ ->insert(std::make_pair(minidump_link.minidump_module_list_index,
+ minidump_link.location)).second) {
LOG(WARNING)
<< "duplicate module_crashpad_info_list minidump_module_list_index "
<< minidump_link.minidump_module_list_index;
return false;
- } else {
- module_crashpad_info_links->insert(std::make_pair(
- minidump_link.minidump_module_list_index, minidump_link.location));
}
}

Powered by Google App Engine
This is Rietveld 408576698