Remove unneeded string copy

This commit is contained in:
Dmitry-Me 2019-11-19 10:19:13 +03:00
parent 4f1db90367
commit 55051b777b
1 changed files with 1 additions and 3 deletions

View File

@ -64,8 +64,7 @@ private:
if (i->first.find("memleak") != std::string::npos) if (i->first.find("memleak") != std::string::npos)
continue; continue;
CLEAR_REDIRECT_ERROUT; CLEAR_REDIRECT_ERROUT;
char* path = new char[i->first.size() + 1]; const char* const path = i->first.c_str();
strcpy(path, i->first.c_str());
const char * const argv[] = { const char * const argv[] = {
#ifdef _WIN32 #ifdef _WIN32
".\\..\\testrunner", ".\\..\\testrunner",
@ -92,7 +91,6 @@ private:
actual.erase(actual.find("..\\"), 3); // Remove '..\' actual.erase(actual.find("..\\"), 3); // Remove '..\'
ASSERT_EQUALS_MSG(expected, actual, i->first); ASSERT_EQUALS_MSG(expected, actual, i->first);
} }
delete[] path;
} }
} }