From be73fd6b5d4f2f10202e0f24fe0e1bfd1fb5a690 Mon Sep 17 00:00:00 2001 From: Tatyana Krasnukha Date: Thu, 21 Jun 2018 19:19:57 +0000 Subject: [PATCH] Remove duplicated check and shared_ptr copying. llvm-svn: 335273 --- lldb/source/Commands/CommandObjectDisassemble.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp index 497a9b7..519e5e2d 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -161,10 +161,9 @@ Status CommandObjectDisassemble::CommandOptions::SetOptionValue( case 'A': if (execution_context) { - auto target_sp = - execution_context ? execution_context->GetTargetSP() : TargetSP(); - auto platform_sp = target_sp ? target_sp->GetPlatform() : PlatformSP(); - arch = Platform::GetAugmentedArchSpec(platform_sp.get(), option_arg); + const auto &target_sp = execution_context->GetTargetSP(); + auto platform_ptr = target_sp ? target_sp->GetPlatform().get() : nullptr; + arch = Platform::GetAugmentedArchSpec(platform_ptr, option_arg); } break; -- 2.7.4