Commit 361e54e3 authored by Marian Klymov's avatar Marian Klymov

Get rid of redundant string initialization

parent 0b9f51a1
......@@ -4613,7 +4613,7 @@ std::string SystemInformationImplementation::ExtractValueFromSysCtl(
std::string SystemInformationImplementation::RunProcess(
std::vector<const char*> args)
{
std::string buffer = "";
std::string buffer;
// Run the application
kwsysProcess* gp = kwsysProcess_New();
......@@ -4711,7 +4711,7 @@ std::string SystemInformationImplementation::ParseValueFromKStat(
std::string buffer = this->RunProcess(args);
std::string value = "";
std::string value;
for (size_t i = buffer.size() - 1; i > 0; i--) {
if (buffer[i] == ' ' || buffer[i] == '\t') {
break;
......
......@@ -1973,7 +1973,7 @@ std::string SystemTools::ConvertToUnixOutputPath(const std::string& path)
}
// escape spaces and () in the path
if (ret.find_first_of(" ") != std::string::npos) {
std::string result = "";
std::string result;
char lastch = 1;
for (const char* ch = ret.c_str(); *ch != '\0'; ++ch) {
// if it is already escaped then don't try to escape it again
......
......@@ -77,7 +77,7 @@ int testCommandLineArguments(int argc, char* argv[])
int some_int_variable = 10;
double some_double_variable = 10.10;
char* some_string_variable = KWSYS_NULLPTR;
std::string some_stl_string_variable = "";
std::string some_stl_string_variable;
bool some_bool_variable = false;
bool some_bool_variable1 = false;
bool bool_arg1 = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment