File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -1294,17 +1294,12 @@ bool Process::HasAssignedIndexIDToThread(uint64_t thread_id) {
1294
1294
}
1295
1295
1296
1296
uint32_t Process::AssignIndexIDToThread (uint64_t thread_id) {
1297
- uint32_t result = 0 ;
1298
- std::map<uint64_t , uint32_t >::iterator iterator =
1299
- m_thread_id_to_index_id_map.find (thread_id);
1300
- if (iterator == m_thread_id_to_index_id_map.end ()) {
1301
- result = ++m_thread_index_id;
1302
- m_thread_id_to_index_id_map[thread_id] = result;
1303
- } else {
1304
- result = iterator->second ;
1305
- }
1297
+ auto [iterator, inserted] =
1298
+ m_thread_id_to_index_id_map.try_emplace (thread_id, m_thread_index_id + 1 );
1299
+ if (inserted)
1300
+ ++m_thread_index_id;
1306
1301
1307
- return result ;
1302
+ return iterator-> second ;
1308
1303
}
1309
1304
1310
1305
StateType Process::GetState () {
You can’t perform that action at this time.
0 commit comments