Skip to content

Commit 8a45c31

Browse files
committed
There is not need to clear a string directly after its creation.
1 parent 95b3d9e commit 8a45c31

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/path.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ std::string Path::simplifyPath(std::string originalPath)
7373
originalPath = originalPath.erase(0, toErase);
7474
}
7575

76-
std::string subPath = "";
76+
std::string subPath;
7777
std::vector<std::string> pathParts;
7878
for (std::size_t i = 0; i < originalPath.size(); ++i) {
7979
if (originalPath[i] == '/' || originalPath[i] == '\\') {

test/testsuite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void TestFixture::processOptions(const options& args)
278278
std::size_t TestFixture::runTests(const options& args)
279279
{
280280
std::string classname(args.which_test());
281-
std::string testname("");
281+
std::string testname;
282282
if (classname.find("::") != std::string::npos) {
283283
testname = classname.substr(classname.find("::") + 2);
284284
classname.erase(classname.find("::"));

test/testtokenize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8095,7 +8095,7 @@ class TestTokenizer : public TestFixture {
80958095
// Preprocess file..
80968096
Preprocessor preprocessor(settings0);
80978097
std::list<std::string> configurations;
8098-
std::string filedata = "";
8098+
std::string filedata;
80998099
std::istringstream fin(raw_code);
81008100
preprocessor.preprocess(fin, filedata, configurations, emptyString, settings0.includePaths);
81018101
const std::string code = preprocessor.getcode(filedata, emptyString, emptyString);

0 commit comments

Comments
 (0)