From f1068cafa04c8038f01d3a8ea31cc790d2f71ad8 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer <eike@sf-mail.de> Date: Tue, 8 Jan 2013 18:22:44 +0100 Subject: [PATCH] SystemInformation: speed up copying process data Append the whole process output in one go to our buffer instead of doing this byte by byte. Change-Id: I060aac43e59d514e999a9fca897ce5fd76fdddd6 --- SystemInformation.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/SystemInformation.cxx b/SystemInformation.cxx index 744d5ec..4e77795 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -4064,10 +4064,7 @@ kwsys_stl::string SystemInformationImplementation::RunProcess(kwsys_stl::vector< while( ( pipe = kwsysProcess_WaitForData(gp,&data,&length,&timeout), (pipe == kwsysProcess_Pipe_STDOUT || pipe == kwsysProcess_Pipe_STDERR) ) ) // wait for 1s { - for(int i=0;i<length;i++) - { - buffer += data[i]; - } + buffer.append(data, length); } kwsysProcess_WaitForExit(gp, 0); -- GitLab