Skip to content

Commit

Permalink
tidy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tal Hadad committed Nov 17, 2024
1 parent f156111 commit 28cdb8a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,7 @@ static std::string currentDirectoryOSCalc() {
}

static const std::string& currentDirectory() {
static std::string curdir = simplecpp::simplifyPath(currentDirectoryOSCalc());
static const std::string curdir = simplecpp::simplifyPath(currentDirectoryOSCalc());
return curdir;
}

Expand All @@ -2698,7 +2698,7 @@ static std::string toAbsolutePath(const std::string& path) {
static std::pair<std::string, bool> extractRelativePathFromAbsolute(const std::string& absolutepath) {
static const std::string prefix = currentDirectory() + "/";
if (startsWith(absolutepath, prefix)) {
std::size_t size = prefix.size();
const std::size_t size = prefix.size();
return std::make_pair(absolutepath.substr(size, absolutepath.size() - size), true);
}
// otherwise
Expand Down Expand Up @@ -3215,8 +3215,7 @@ static std::string getFileIdPath(const std::map<std::string, simplecpp::TokenLis
}

for (std::list<std::string>::const_iterator it = dui.includePaths.begin(); it != dui.includePaths.end(); ++it) {
std::string s = simplecpp::simplifyPath(getIncludePathFileName(*it, header));
const std::string match = findPathInMapBothRelativeAndAbsolute(filedata, s);
const std::string match = findPathInMapBothRelativeAndAbsolute(filedata, simplecpp::simplifyPath(getIncludePathFileName(*it, header)));
if (!match.empty()) {
return match;
}
Expand Down

0 comments on commit 28cdb8a

Please sign in to comment.