summaryrefslogtreecommitdiffstats
path: root/Source/cmExternalMakefileProjectGenerator.cxx
diff options
context:
space:
mode:
authorMeekness Adesina <zenon8adams@gmail.com>2023-05-18 21:11:41 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-19 13:56:07 (GMT)
commit8c066045ec02cdfc7396a20b842838ae87610512 (patch)
tree2cf7e57385479bcb24951623136363ff328417d0 /Source/cmExternalMakefileProjectGenerator.cxx
parentf64a774b49baaba40056edd8c5f8eb97292dd7d0 (diff)
downloadCMake-8c066045ec02cdfc7396a20b842838ae87610512.zip
CMake-8c066045ec02cdfc7396a20b842838ae87610512.tar.gz
CMake-8c066045ec02cdfc7396a20b842838ae87610512.tar.bz2
Source: Improve some code readability and efficiency
- Replace raw loop with STL find algorithm for improved efficiency - Update functions for enhanced readability and understandability
Diffstat (limited to 'Source/cmExternalMakefileProjectGenerator.cxx')
-rw-r--r--Source/cmExternalMakefileProjectGenerator.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx
index 5895d66..5fecb35 100644
--- a/Source/cmExternalMakefileProjectGenerator.cxx
+++ b/Source/cmExternalMakefileProjectGenerator.cxx
@@ -17,14 +17,13 @@ void cmExternalMakefileProjectGenerator::EnableLanguage(
std::string cmExternalMakefileProjectGenerator::CreateFullGeneratorName(
const std::string& globalGenerator, const std::string& extraGenerator)
{
- std::string fullName;
- if (!globalGenerator.empty()) {
- if (!extraGenerator.empty()) {
- fullName = cmStrCat(extraGenerator, " - ");
- }
- fullName += globalGenerator;
+ if (globalGenerator.empty()) {
+ return {};
}
- return fullName;
+ if (extraGenerator.empty()) {
+ return globalGenerator;
+ }
+ return cmStrCat(extraGenerator, " - ", globalGenerator);
}
bool cmExternalMakefileProjectGenerator::Open(