Skip to content

Commit cfddd3e

Browse files
authored
made AnalyzerInformation::mAnalyzerInfoFile a local variable (danmar#8136)
1 parent 61c6672 commit cfddd3e

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

lib/analyzerinfo.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ std::string AnalyzerInformation::getFilesTxt(const std::list<std::string> &sourc
7878

7979
void AnalyzerInformation::close()
8080
{
81-
mAnalyzerInfoFile.clear();
8281
if (mOutputStream.is_open()) {
8382
mOutputStream << "</analyzerinfo>\n";
8483
mOutputStream.close();
@@ -152,19 +151,17 @@ bool AnalyzerInformation::analyzeFile(const std::string &buildDir, const std::st
152151
return true;
153152
close();
154153

155-
mAnalyzerInfoFile = AnalyzerInformation::getAnalyzerInfoFile(buildDir,sourcefile,cfg,fileIndex);
154+
const std::string analyzerInfoFile = AnalyzerInformation::getAnalyzerInfoFile(buildDir,sourcefile,cfg,fileIndex);
156155

157156
tinyxml2::XMLDocument analyzerInfoDoc;
158-
const tinyxml2::XMLError xmlError = analyzerInfoDoc.LoadFile(mAnalyzerInfoFile.c_str());
157+
const tinyxml2::XMLError xmlError = analyzerInfoDoc.LoadFile(analyzerInfoFile.c_str());
159158
if (xmlError == tinyxml2::XML_SUCCESS && skipAnalysis(analyzerInfoDoc, hash, errors))
160159
return false;
161160

162-
mOutputStream.open(mAnalyzerInfoFile);
161+
mOutputStream.open(analyzerInfoFile);
163162
if (mOutputStream.is_open()) {
164163
mOutputStream << "<?xml version=\"1.0\"?>\n";
165164
mOutputStream << "<analyzerinfo hash=\"" << hash << "\">\n";
166-
} else {
167-
mAnalyzerInfoFile.clear();
168165
}
169166

170167
return true;

lib/analyzerinfo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class CPPCHECKLIB AnalyzerInformation {
8888

8989
private:
9090
std::ofstream mOutputStream;
91-
std::string mAnalyzerInfoFile;
9291
};
9392

9493
/// @}

0 commit comments

Comments
 (0)