diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-11 10:40:26 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-12 13:22:47 (GMT) |
commit | 7d5095796ab616cf9b709036387bb95ab9984141 (patch) | |
tree | c010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmDocumentationFormatter.cxx | |
parent | 00975e926199eea21763470e2ab876246e36669a (diff) | |
download | CMake-7d5095796ab616cf9b709036387bb95ab9984141.zip CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.bz2 |
Meta: modernize old-fashioned loops to range-based `for`.
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
Diffstat (limited to 'Source/cmDocumentationFormatter.cxx')
-rw-r--r-- | Source/cmDocumentationFormatter.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 0018263..6b996e4 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -168,26 +168,25 @@ void cmDocumentationFormatter::PrintSection( os << section.GetName() << "\n"; const std::vector<cmDocumentationEntry>& entries = section.GetEntries(); - for (std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); - op != entries.end(); ++op) { - if (!op->Name.empty()) { - os << " " << op->Name; + for (cmDocumentationEntry const& entry : entries) { + if (!entry.Name.empty()) { + os << " " << entry.Name; this->TextIndent = " "; int align = static_cast<int>(strlen(this->TextIndent)) - 4; - for (int i = static_cast<int>(op->Name.size()); i < align; ++i) { + for (int i = static_cast<int>(entry.Name.size()); i < align; ++i) { os << " "; } - if (op->Name.size() > strlen(this->TextIndent) - 4) { + if (entry.Name.size() > strlen(this->TextIndent) - 4) { os << "\n"; os.write(this->TextIndent, strlen(this->TextIndent) - 2); } os << "= "; - this->PrintColumn(os, op->Brief.c_str()); + this->PrintColumn(os, entry.Brief.c_str()); os << "\n"; } else { os << "\n"; this->TextIndent = ""; - this->PrintFormatted(os, op->Brief.c_str()); + this->PrintFormatted(os, entry.Brief.c_str()); } } os << "\n"; |