[Lldb-commits] [lldb] [lldb] Use if-with-initializer pattern in SBTarget (NFC) (PR #141284)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed May 28 00:18:18 PDT 2025


================
@@ -1593,11 +1545,12 @@ SBModule SBTarget::FindModule(const SBFileSpec &sb_file_spec) {
   LLDB_INSTRUMENT_VA(this, sb_file_spec);
 
   SBModule sb_module;
-  TargetSP target_sp(GetSP());
-  if (target_sp && sb_file_spec.IsValid()) {
-    ModuleSpec module_spec(*sb_file_spec);
-    // The module list is thread safe, no need to lock
-    sb_module.SetSP(target_sp->GetImages().FindFirstModule(module_spec));
+  if (TargetSP target_sp = GetSP()) {
+    if (sb_file_spec.IsValid()) {
----------------
labath wrote:

missed two :)

https://github.com/llvm/llvm-project/pull/141284


More information about the lldb-commits mailing list