Skip to content

Commit

Permalink
Optimize for RVO
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Sep 22, 2020
1 parent b2fe6b7 commit fdbae9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/common/src/System_Other.cpp
Expand Up @@ -32,7 +32,7 @@ boost::filesystem::path System::getHomePath()

std::string System::getUserName()
{
const std::string name = getEnvVar("USER");
std::string name = getEnvVar("USER");
if(name.empty())
throw std::runtime_error("Could not get username");
return name;
Expand Down
2 changes: 1 addition & 1 deletion libs/common/src/Tokenizer.cpp
Expand Up @@ -33,7 +33,7 @@ std::string Tokenizer::next()
return "";

const auto newPos = data.find_first_of(delimiter, curPos);
const auto result = data.substr(curPos, newPos - curPos);
auto result = data.substr(curPos, newPos - curPos);

curPos = (newPos == std::string::npos) ? newPos : newPos + 1;
return result;
Expand Down

0 comments on commit fdbae9f

Please sign in to comment.