cmStrCat: use character literals where possible

Found and replaced using the `cmstrcat-to-char-literal` rule for
`ast-grep`.
This commit is contained in:
Ben Boeckel
2025-05-15 18:29:14 +02:00
parent 23779057fd
commit 557c44b93e
70 changed files with 196 additions and 198 deletions
+3 -3
View File
@@ -142,7 +142,7 @@ void cmFileAPI::RemoveOldReplyFiles()
std::vector<std::string> files = this->LoadDir(reply_dir);
for (std::string const& f : files) {
if (this->ReplyFiles.find(f) == this->ReplyFiles.end()) {
std::string file = cmStrCat(reply_dir, "/", f);
std::string file = cmStrCat(reply_dir, '/', f);
cmSystemTools::RemoveFile(file);
}
}
@@ -207,7 +207,7 @@ std::string cmFileAPI::WriteJsonFile(
// Compute the final name for the file.
std::string suffix = computeSuffix(tmpFile);
std::string suffixWithExtension = cmStrCat("-", suffix, ".json");
std::string suffixWithExtension = cmStrCat('-', suffix, ".json");
fileName = cmStrCat(prefix, suffixWithExtension);
// Truncate the file name length
@@ -225,7 +225,7 @@ std::string cmFileAPI::WriteJsonFile(
suffix = cmCryptoHash(cmCryptoHash::AlgoSHA256)
.HashString(toBeRemoved)
.substr(0, newHashLength);
suffixWithExtension = cmStrCat("-", suffix, ".json");
suffixWithExtension = cmStrCat('-', suffix, ".json");
fileName.replace(startPos, overLength, suffixWithExtension);
}