diff options
author | Vitaly Stakhovsky <vvs31415@users.noreply.gitlab.com> | 2023-01-15 15:13:14 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@users.noreply.gitlab.com> | 2023-01-16 04:39:02 (GMT) |
commit | b3edfcf46ec1514a376d4e3dca7538cc750844d5 (patch) | |
tree | c5a26d80efd9bbeb2783d8e6508097a2d9ee0b09 /Source/CPack/cmCPackPKGGenerator.cxx | |
parent | 701badbd20a33d8f955cb6d86016d5bf415b8212 (diff) | |
download | CMake-b3edfcf46ec1514a376d4e3dca7538cc750844d5.zip CMake-b3edfcf46ec1514a376d4e3dca7538cc750844d5.tar.gz CMake-b3edfcf46ec1514a376d4e3dca7538cc750844d5.tar.bz2 |
cmValue: Use operator* explicitly to convert to std::string; avoid extra call
Diffstat (limited to 'Source/CPack/cmCPackPKGGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackPKGGenerator.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index 7b9f6cf..76ef091 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -58,16 +58,17 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName, ? cmStrCat("CPACK_", genName, "_BACKGROUND") : cmStrCat("CPACK_", genName, "_BACKGROUND_", paramSuffix); cmValue bgFileName = this->GetOption(opt); - if (bgFileName == nullptr) { + if (!bgFileName) { return; } - std::string bgFilePath = cmStrCat(metapackageFile, "/Contents/", bgFileName); + std::string bgFilePath = + cmStrCat(metapackageFile, "/Contents/", *bgFileName); if (!cmSystemTools::FileExists(bgFilePath)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Background image doesn't exist in the resource directory: " - << bgFileName << std::endl); + << *bgFileName << std::endl); return; } @@ -77,16 +78,16 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName, xout.StartElement(cmStrCat("background-", themeName)); } - xout.Attribute("file", bgFileName); + xout.Attribute("file", *bgFileName); cmValue param = this->GetOption(cmStrCat(opt, "_ALIGNMENT")); if (param != nullptr) { - xout.Attribute("alignment", param); + xout.Attribute("alignment", *param); } param = this->GetOption(cmStrCat(opt, "_SCALING")); if (param != nullptr) { - xout.Attribute("scaling", param); + xout.Attribute("scaling", *param); } // Apple docs say that you must provide either mime-type or uti @@ -94,12 +95,12 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName, // doesn't have them, so don't make them mandatory. param = this->GetOption(cmStrCat(opt, "_MIME_TYPE")); if (param != nullptr) { - xout.Attribute("mime-type", param); + xout.Attribute("mime-type", *param); } param = this->GetOption(cmStrCat(opt, "_UTI")); if (param != nullptr) { - xout.Attribute("uti", param); + xout.Attribute("uti", *param); } xout.EndElement(); |