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

Unified Diff: minidump/minidump_thread_id_map.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: minidump/minidump_thread_id_map.cc
diff --git a/minidump/minidump_thread_id_map.cc b/minidump/minidump_thread_id_map.cc
index 1fab698edcc9c99a76f664acc1d4416c2f2d23f2..327d12e1352a9bf36318711b29e12993974e6f69 100644
--- a/minidump/minidump_thread_id_map.cc
+++ b/minidump/minidump_thread_id_map.cc
@@ -38,11 +38,10 @@ void BuildMinidumpThreadIDMap(
uint64_t thread_id_64 = thread_snapshot->ThreadID();
if (thread_id_map->find(thread_id_64) == thread_id_map->end()) {
uint32_t thread_id_32 = static_cast<uint32_t>(thread_id_64);
- if (thread_ids_32.find(thread_id_32) != thread_ids_32.end()) {
+ if (!thread_ids_32.insert(thread_id_32).second) {
collision = true;
break;
}
- thread_ids_32.insert(thread_id_32);
thread_id_map->insert(std::make_pair(thread_id_64, thread_id_32));
}
}

Powered by Google App Engine
This is Rietveld 408576698