Skip to content

Commit

Permalink
reduced scope of function call in getFileName() (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave authored Feb 27, 2024
1 parent 1b29369 commit 03dee1b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3085,9 +3085,11 @@ static std::string getFileName(const std::map<std::string, simplecpp::TokenList
return (filedata.find(header) != filedata.end()) ? simplecpp::simplifyPath(header) : "";
}

const std::string relativeFilename = getRelativeFileName(sourcefile, header);
if (!systemheader && filedata.find(relativeFilename) != filedata.end())
return relativeFilename;
if (!systemheader) {
const std::string relativeFilename = getRelativeFileName(sourcefile, header);
if (filedata.find(relativeFilename) != filedata.end())
return relativeFilename;
}

for (std::list<std::string>::const_iterator it = dui.includePaths.begin(); it != dui.includePaths.end(); ++it) {
std::string s = simplecpp::simplifyPath(getIncludePathFileName(*it, header));
Expand Down

0 comments on commit 03dee1b

Please sign in to comment.