There is not need to clear a string directly after its creation.

This commit is contained in:
orbitcowboy 2016-11-30 10:39:14 +01:00
parent 95b3d9eaa1
commit 8a45c3192b
3 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ std::string Path::simplifyPath(std::string originalPath)
originalPath = originalPath.erase(0, toErase); originalPath = originalPath.erase(0, toErase);
} }
std::string subPath = ""; std::string subPath;
std::vector<std::string> pathParts; std::vector<std::string> pathParts;
for (std::size_t i = 0; i < originalPath.size(); ++i) { for (std::size_t i = 0; i < originalPath.size(); ++i) {
if (originalPath[i] == '/' || originalPath[i] == '\\') { if (originalPath[i] == '/' || originalPath[i] == '\\') {

View File

@ -278,7 +278,7 @@ void TestFixture::processOptions(const options& args)
std::size_t TestFixture::runTests(const options& args) std::size_t TestFixture::runTests(const options& args)
{ {
std::string classname(args.which_test()); std::string classname(args.which_test());
std::string testname(""); std::string testname;
if (classname.find("::") != std::string::npos) { if (classname.find("::") != std::string::npos) {
testname = classname.substr(classname.find("::") + 2); testname = classname.substr(classname.find("::") + 2);
classname.erase(classname.find("::")); classname.erase(classname.find("::"));

View File

@ -8095,7 +8095,7 @@ private:
// Preprocess file.. // Preprocess file..
Preprocessor preprocessor(settings0); Preprocessor preprocessor(settings0);
std::list<std::string> configurations; std::list<std::string> configurations;
std::string filedata = ""; std::string filedata;
std::istringstream fin(raw_code); std::istringstream fin(raw_code);
preprocessor.preprocess(fin, filedata, configurations, emptyString, settings0.includePaths); preprocessor.preprocess(fin, filedata, configurations, emptyString, settings0.includePaths);
const std::string code = preprocessor.getcode(filedata, emptyString, emptyString); const std::string code = preprocessor.getcode(filedata, emptyString, emptyString);