diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2022-11-22 19:42:54 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2022-11-29 17:39:45 (GMT) |
commit | d64adb9267213c0031b376633b70707ddcfc9ba6 (patch) | |
tree | f9a18fc6b412e24bbba34e6d3b8203441b305309 /Source/cmVisualStudioSlnParser.cxx | |
parent | f76ebc3c05fdb7e90673dd98392a01c41f056b18 (diff) | |
download | CMake-d64adb9267213c0031b376633b70707ddcfc9ba6.zip CMake-d64adb9267213c0031b376633b70707ddcfc9ba6.tar.gz CMake-d64adb9267213c0031b376633b70707ddcfc9ba6.tar.bz2 |
clang-tidy: fix `readability-string-compare` lints
Diffstat (limited to 'Source/cmVisualStudioSlnParser.cxx')
-rw-r--r-- | Source/cmVisualStudioSlnParser.cxx | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/Source/cmVisualStudioSlnParser.cxx b/Source/cmVisualStudioSlnParser.cxx index 756245d..71c758e 100644 --- a/Source/cmVisualStudioSlnParser.cxx +++ b/Source/cmVisualStudioSlnParser.cxx @@ -206,7 +206,7 @@ bool cmVisualStudioSlnParser::State::Process( this->Stack.push(FileStateTopLevel); break; case FileStateTopLevel: - if (line.GetTag().compare("Project") == 0) { + if (line.GetTag() == "Project") { if (line.GetValueCount() != 3) { result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); return false; @@ -221,12 +221,12 @@ bool cmVisualStudioSlnParser::State::Process( } else { this->IgnoreUntilTag("EndProject"); } - } else if (line.GetTag().compare("Global") == 0) { + } else if (line.GetTag() == "Global") { this->Stack.push(FileStateGlobal); - } else if (line.GetTag().compare("VisualStudioVersion") == 0) { + } else if (line.GetTag() == "VisualStudioVersion") { output.SetVisualStudioVersion(line.GetValue(0)); - } else if (line.GetTag().compare("MinimumVisualStudioVersion") == 0) { + } else if (line.GetTag() == "MinimumVisualStudioVersion") { output.SetMinimumVisualStudioVersion(line.GetValue(0)); } else { result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); @@ -234,11 +234,11 @@ bool cmVisualStudioSlnParser::State::Process( } break; case FileStateProject: - if (line.GetTag().compare("EndProject") == 0) { + if (line.GetTag() == "EndProject") { this->Stack.pop(); - } else if (line.GetTag().compare("ProjectSection") == 0) { - if (line.GetArg().compare("ProjectDependencies") == 0 && - line.GetValue(0).compare("postProject") == 0) { + } else if (line.GetTag() == "ProjectSection") { + if (line.GetArg() == "ProjectDependencies" && + line.GetValue(0) == "postProject") { if (this->RequestedData.test(DataGroupProjectDependenciesBit)) { this->Stack.push(FileStateProjectDependencies); } else { @@ -253,7 +253,7 @@ bool cmVisualStudioSlnParser::State::Process( } break; case FileStateProjectDependencies: - if (line.GetTag().compare("EndProjectSection") == 0) { + if (line.GetTag() == "EndProjectSection") { this->Stack.pop(); } else if (line.IsKeyValuePair()) { // implement dependency storing here, once needed @@ -264,26 +264,25 @@ bool cmVisualStudioSlnParser::State::Process( } break; case FileStateGlobal: - if (line.GetTag().compare("EndGlobal") == 0) { + if (line.GetTag() == "EndGlobal") { this->Stack.pop(); - } else if (line.GetTag().compare("GlobalSection") == 0) { - if (line.GetArg().compare("SolutionConfigurationPlatforms") == 0 && - line.GetValue(0).compare("preSolution") == 0) { + } else if (line.GetTag() == "GlobalSection") { + if (line.GetArg() == "SolutionConfigurationPlatforms" && + line.GetValue(0) == "preSolution") { if (this->RequestedData.test(DataGroupSolutionConfigurationsBit)) { this->Stack.push(FileStateSolutionConfigurations); } else { this->IgnoreUntilTag("EndGlobalSection"); } - } else if (line.GetArg().compare("ProjectConfigurationPlatforms") == - 0 && - line.GetValue(0).compare("postSolution") == 0) { + } else if (line.GetArg() == "ProjectConfigurationPlatforms" && + line.GetValue(0) == "postSolution") { if (this->RequestedData.test(DataGroupProjectConfigurationsBit)) { this->Stack.push(FileStateProjectConfigurations); } else { this->IgnoreUntilTag("EndGlobalSection"); } - } else if (line.GetArg().compare("NestedProjects") == 0 && - line.GetValue(0).compare("preSolution") == 0) { + } else if (line.GetArg() == "NestedProjects" && + line.GetValue(0) == "preSolution") { if (this->RequestedData.test(DataGroupSolutionFiltersBit)) { this->Stack.push(FileStateSolutionFilters); } else { @@ -301,7 +300,7 @@ bool cmVisualStudioSlnParser::State::Process( } break; case FileStateSolutionConfigurations: - if (line.GetTag().compare("EndGlobalSection") == 0) { + if (line.GetTag() == "EndGlobalSection") { this->Stack.pop(); } else if (line.IsKeyValuePair()) { output.AddConfiguration(line.GetValue(0)); @@ -311,7 +310,7 @@ bool cmVisualStudioSlnParser::State::Process( } break; case FileStateProjectConfigurations: - if (line.GetTag().compare("EndGlobalSection") == 0) { + if (line.GetTag() == "EndGlobalSection") { this->Stack.pop(); } else if (line.IsKeyValuePair()) { std::vector<std::string> tagElements = @@ -332,7 +331,7 @@ bool cmVisualStudioSlnParser::State::Process( return false; } - if (activeBuild.compare("ActiveCfg") == 0) { + if (activeBuild == "ActiveCfg") { projectEntry->AddProjectConfiguration(solutionConfiguration, line.GetValue(0)); } @@ -342,7 +341,7 @@ bool cmVisualStudioSlnParser::State::Process( } break; case FileStateSolutionFilters: - if (line.GetTag().compare("EndGlobalSection") == 0) { + if (line.GetTag() == "EndGlobalSection") { this->Stack.pop(); } else if (line.IsKeyValuePair()) { // implement filter storing here, once needed @@ -353,7 +352,7 @@ bool cmVisualStudioSlnParser::State::Process( } break; case FileStateGlobalSection: - if (line.GetTag().compare("EndGlobalSection") == 0) { + if (line.GetTag() == "EndGlobalSection") { this->Stack.pop(); } else if (line.IsKeyValuePair()) { // implement section storing here, once needed |