summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoMocUic.cxx
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2020-03-22 14:29:43 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2020-03-24 13:32:05 (GMT)
commit1e4b5c7d090fc77daa2aaede0bd57d476e3f45ed (patch)
tree0215a0628dc36e38956f2fea531916f71a5d093b /Source/cmQtAutoMocUic.cxx
parent7099db5dd48d36e5d39ab17219278d834c8a88a7 (diff)
downloadCMake-1e4b5c7d090fc77daa2aaede0bd57d476e3f45ed.zip
CMake-1e4b5c7d090fc77daa2aaede0bd57d476e3f45ed.tar.gz
CMake-1e4b5c7d090fc77daa2aaede0bd57d476e3f45ed.tar.bz2
Refactor: Avoid `std::endl` where it's not necessary (part 2)
The `std::endl` manipulator, except inserting `\n` character, also performs `os.flush()`, which may lead to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning. * replace multiple `operator<<` calls on a string literal w/ the only call and the only (bigger) string literal; * replace one character string literal used in `operator<<` w/ a char literal.
Diffstat (limited to 'Source/cmQtAutoMocUic.cxx')
-rw-r--r--Source/cmQtAutoMocUic.cxx23
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 893bd6b..36dd627 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -700,27 +700,27 @@ bool cmQtAutoMocUicT::ParseCacheT::WriteToFile(std::string const& fileName)
if (!ofs) {
return false;
}
- ofs << "# Generated by CMake. Changes will be overwritten." << std::endl;
+ ofs << "# Generated by CMake. Changes will be overwritten.\n";
for (auto const& pair : Map_) {
- ofs << pair.first << std::endl;
+ ofs << pair.first << '\n';
FileT const& file = *pair.second;
if (!file.Moc.Macro.empty()) {
- ofs << " mmc:" << file.Moc.Macro << std::endl;
+ ofs << " mmc:" << file.Moc.Macro << '\n';
}
for (IncludeKeyT const& item : file.Moc.Include.Underscore) {
- ofs << " miu:" << item.Key << std::endl;
+ ofs << " miu:" << item.Key << '\n';
}
for (IncludeKeyT const& item : file.Moc.Include.Dot) {
- ofs << " mid:" << item.Key << std::endl;
+ ofs << " mid:" << item.Key << '\n';
}
for (std::string const& item : file.Moc.Depends) {
- ofs << " mdp:" << item << std::endl;
+ ofs << " mdp:" << item << '\n';
}
for (IncludeKeyT const& item : file.Uic.Include) {
- ofs << " uic:" << item.Key << std::endl;
+ ofs << " uic:" << item.Key << '\n';
}
for (std::string const& item : file.Uic.Depends) {
- ofs << " udp:" << item << std::endl;
+ ofs << " udp:" << item << '\n';
}
}
return ofs.Close();
@@ -2211,9 +2211,9 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
" for writing."));
return;
}
- ofs << BaseConst().DepFileRuleName << ": \\" << std::endl;
+ ofs << BaseConst().DepFileRuleName << ": \\\n";
for (const std::string& file : dependencies) {
- ofs << '\t' << escapeDependencyPath(file) << " \\" << std::endl;
+ ofs << '\t' << escapeDependencyPath(file) << " \\\n";
if (!ofs.good()) {
LogError(GenT::GEN,
cmStrCat("Writing depfile", MessagePath(BaseConst().DepFile),
@@ -2224,8 +2224,7 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
// Add the CMake executable to re-new cache data if necessary.
// Also, this is the last entry, so don't add a backslash.
- ofs << '\t' << escapeDependencyPath(BaseConst().CMakeExecutable)
- << std::endl;
+ ofs << '\t' << escapeDependencyPath(BaseConst().CMakeExecutable) << '\n';
}
void cmQtAutoMocUicT::JobFinishT::Process()