diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2020-03-22 14:29:43 (GMT) |
---|---|---|
committer | Alex Turbov <i.zaufi@gmail.com> | 2020-03-24 13:32:05 (GMT) |
commit | 1e4b5c7d090fc77daa2aaede0bd57d476e3f45ed (patch) | |
tree | 0215a0628dc36e38956f2fea531916f71a5d093b /Source/cmDependsC.cxx | |
parent | 7099db5dd48d36e5d39ab17219278d834c8a88a7 (diff) | |
download | CMake-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/cmDependsC.cxx')
-rw-r--r-- | Source/cmDependsC.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index e30d959..8d2d520 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -212,17 +212,17 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, // convert the dependencies to paths relative to the home output // directory. We must do the same here. std::string obj_m = cmSystemTools::ConvertToOutputPath(obj_i); - internalDepends << obj_i << std::endl; + internalDepends << obj_i << '\n'; for (std::string const& dep : dependencies) { makeDepends << obj_m << ": " << cmSystemTools::ConvertToOutputPath( this->LocalGenerator->MaybeConvertToRelativePath(binDir, dep)) - << std::endl; - internalDepends << " " << dep << std::endl; + << '\n'; + internalDepends << ' ' << dep << '\n'; } - makeDepends << std::endl; + makeDepends << '\n'; return true; } @@ -312,17 +312,17 @@ void cmDependsC::WriteCacheFile() const for (auto const& fileIt : this->FileCache) { if (fileIt.second.Used) { - cacheOut << fileIt.first << std::endl; + cacheOut << fileIt.first << '\n'; for (UnscannedEntry const& inc : fileIt.second.UnscannedEntries) { - cacheOut << inc.FileName << std::endl; + cacheOut << inc.FileName << '\n'; if (inc.QuotedLocation.empty()) { - cacheOut << "-" << std::endl; + cacheOut << '-' << '\n'; } else { - cacheOut << inc.QuotedLocation << std::endl; + cacheOut << inc.QuotedLocation << '\n'; } } - cacheOut << std::endl; + cacheOut << '\n'; } } } |