Skip to content

Commit

Permalink
avoid duplicated XMLElement::Attribute() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Sep 18, 2024
1 parent 023bf3d commit 97821f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/importproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,8 +1267,9 @@ bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings *setti
for (const tinyxml2::XMLElement *node = rootnode->FirstChildElement(); node; node = node->NextSiblingElement()) {
const char* name = node->Name();
if (strcmp(name, CppcheckXml::RootPathName) == 0) {
if (node->Attribute(CppcheckXml::RootPathNameAttrib)) {
temp.basePaths.push_back(joinRelativePath(path, node->Attribute(CppcheckXml::RootPathNameAttrib)));
const char* attr = node->Attribute(CppcheckXml::RootPathNameAttrib);
if (attr) {
temp.basePaths.push_back(joinRelativePath(path, attr));
temp.relativePaths = true;
}
} else if (strcmp(name, CppcheckXml::BuildDirElementName) == 0)
Expand Down

0 comments on commit 97821f8

Please sign in to comment.