Skip to content

Commit a32c516

Browse files
committed
Some cleanup that Pavel suggested
1 parent 06e493f commit a32c516

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,8 @@ Status ProcessMinidump::DoLoadCore() {
218218
if (!m_exceptions_by_tid
219219
.try_emplace(exception_stream->ThreadId, exception_stream.get())
220220
.second) {
221-
// We only cast to avoid the warning around converting little endian in
222-
// printf.
223-
return Status::FromErrorStringWithFormat(
224-
"Duplicate exception stream for tid %" PRIu32,
225-
(uint32_t)exception_stream->ThreadId);
221+
return Status::FromErrorStringWithFormatv(
222+
"Duplicate exception stream for tid {0}", exception_stream->ThreadId);
226223
}
227224
}
228225

@@ -399,8 +396,9 @@ bool ProcessMinidump::DoUpdateThreadList(ThreadList &old_thread_list,
399396
LocationDescriptor context_location = thread.Context;
400397

401398
// If the minidump contains an exception context, use it
402-
if (m_exceptions_by_tid.count(thread.ThreadId) > 0)
403-
context_location = m_exceptions_by_tid[thread.ThreadId].ThreadContext;
399+
if (auto it = m_exceptions_by_tid.find(thread.ThreadId);
400+
it != m_exceptions_by_tid.end())
401+
context_location = it->second.ThreadContext;
404402

405403
llvm::ArrayRef<uint8_t> context;
406404
if (!m_is_wow64)

0 commit comments

Comments
 (0)