diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-09-04 20:17:22 (GMT) |
---|---|---|
committer | Regina Pfeifer <regina@mailbox.org> | 2019-09-10 20:21:41 (GMT) |
commit | d25a5a7ec91bfa072d3cf1a302830a54506c88c0 (patch) | |
tree | d06203c8e5b5fdd38645e0fb9b284ded26651f44 /Source/cmRST.cxx | |
parent | bbf48c494ad28d1c8ac5aa6e4cecb35c2cbf1b84 (diff) | |
download | CMake-d25a5a7ec91bfa072d3cf1a302830a54506c88c0.zip CMake-d25a5a7ec91bfa072d3cf1a302830a54506c88c0.tar.gz CMake-d25a5a7ec91bfa072d3cf1a302830a54506c88c0.tar.bz2 |
clang-tidy: modernize-use-auto
Set the MinTypeNameLength option to an impossibly high value in order
to limit the diagnostics to iterators. Leave new expressions and cast
expressions for later.
Diffstat (limited to 'Source/cmRST.cxx')
-rw-r--r-- | Source/cmRST.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 1f9aae8..aa394e5 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -320,8 +320,7 @@ std::string cmRST::ReplaceSubstitutions(std::string const& line) std::string::size_type start = this->Substitution.start(2); std::string::size_type end = this->Substitution.end(2); std::string substitute = this->Substitution.match(3); - std::map<std::string, std::string>::iterator replace = - this->Replace.find(substitute); + auto replace = this->Replace.find(substitute); if (replace != this->Replace.end()) { std::pair<std::set<std::string>::iterator, bool> replaced = this->Replaced.insert(substitute); @@ -451,10 +450,10 @@ void cmRST::UnindentLines(std::vector<std::string>& lines) } } - std::vector<std::string>::const_iterator it = lines.begin(); + auto it = lines.cbegin(); size_t leadingEmpty = std::distance(it, cmFindNot(lines, std::string())); - std::vector<std::string>::const_reverse_iterator rit = lines.rbegin(); + auto rit = lines.crbegin(); size_t trailingEmpty = std::distance(rit, cmFindNot(cmReverseRange(lines), std::string())); @@ -464,7 +463,7 @@ void cmRST::UnindentLines(std::vector<std::string>& lines) return; } - std::vector<std::string>::iterator contentEnd = cmRotate( - lines.begin(), lines.begin() + leadingEmpty, lines.end() - trailingEmpty); + auto contentEnd = cmRotate(lines.begin(), lines.begin() + leadingEmpty, + lines.end() - trailingEmpty); lines.erase(contentEnd, lines.end()); } |