Get rid of `cmdString` temporary variable in ManagedDebugger::RunProcess()
authorAndrey Okoshkin <a.okoshkin@samsung.com>
Thu, 8 Feb 2018 08:46:19 +0000 (11:46 +0300)
committerAndrey Okoshkin <a.okoshkin@samsung.com>
Thu, 8 Feb 2018 08:46:19 +0000 (11:46 +0300)
src/debug/netcoredbg/manageddebugger.cpp

index 26c91f86015f7a215e19e18fcd7c0a2d51197575..145d0cf970e848f0e40aef616ec155fcfc3b8a61 100644 (file)
@@ -984,7 +984,6 @@ HRESULT ManagedDebugger::RunProcess(std::string fileExec, std::vector<std::strin
     {
         ss << " \"" << EscapeShellArg(arg) << "\"";
     }
-    std::string cmdString = ss.str();
 
     m_startupReady = false;
     m_clrPath.clear();
@@ -993,7 +992,7 @@ HRESULT ManagedDebugger::RunProcess(std::string fileExec, std::vector<std::strin
     LPVOID lpEnvironment = nullptr; // as current
     LPCWSTR lpCurrentDirectory = nullptr; // as current
     HANDLE resumeHandle;
-    IfFailRet(CreateProcessForLaunch(const_cast<LPWSTR>(to_utf16(cmdString).c_str()), bSuspendProcess, lpEnvironment, lpCurrentDirectory, &m_processId, &resumeHandle));
+    IfFailRet(CreateProcessForLaunch(const_cast<LPWSTR>(to_utf16(ss.str()).c_str()), bSuspendProcess, lpEnvironment, lpCurrentDirectory, &m_processId, &resumeHandle));
 
     IfFailRet(RegisterForRuntimeStartup(m_processId, ManagedDebugger::StartupCallback, this, &m_unregisterToken));