Only ask once if we have no commands. NFC.
authorJim Ingham <jingham@apple.com>
Thu, 31 Oct 2019 01:02:50 +0000 (18:02 -0700)
committerJim Ingham <jingham@apple.com>
Thu, 31 Oct 2019 01:04:03 +0000 (18:04 -0700)
lldb/source/Commands/CommandObjectBreakpoint.cpp

index 799066e..5d0cc3d 100644 (file)
@@ -146,15 +146,13 @@ public:
 
   Status OptionParsingFinished(ExecutionContext *execution_context) override {
     if (!m_commands.empty()) {
-      if (!m_commands.empty()) {
-        auto cmd_data = std::make_unique<BreakpointOptions::CommandData>();
+      auto cmd_data = std::make_unique<BreakpointOptions::CommandData>();
 
-        for (std::string &str : m_commands)
-          cmd_data->user_source.AppendString(str);
+      for (std::string &str : m_commands)
+        cmd_data->user_source.AppendString(str);
 
-        cmd_data->stop_on_error = true;
-        m_bp_opts.SetCommandDataCallback(cmd_data);
-      }
+      cmd_data->stop_on_error = true;
+      m_bp_opts.SetCommandDataCallback(cmd_data);
     }
     return Status();
   }