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/cmStateDirectory.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/cmStateDirectory.cxx')
-rw-r--r-- | Source/cmStateDirectory.cxx | 51 |
1 files changed, 18 insertions, 33 deletions
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index df96bd3..c14bf4a 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -175,11 +175,9 @@ cmStateDirectory::cmStateDirectory( template <typename T, typename U> cmStringRange GetPropertyContent(T const& content, U contentEndPosition) { - std::vector<std::string>::const_iterator end = - content.begin() + contentEndPosition; + auto end = content.begin() + contentEndPosition; - std::vector<std::string>::const_reverse_iterator rbegin = - cmMakeReverseIterator(end); + auto rbegin = cmMakeReverseIterator(end); rbegin = std::find(rbegin, content.rend(), cmPropertySentinal); return cmMakeRange(rbegin.base(), end); @@ -189,17 +187,14 @@ template <typename T, typename U, typename V> cmBacktraceRange GetPropertyBacktraces(T const& content, U const& backtraces, V contentEndPosition) { - std::vector<std::string>::const_iterator entryEnd = - content.begin() + contentEndPosition; + auto entryEnd = content.begin() + contentEndPosition; - std::vector<std::string>::const_reverse_iterator rbegin = - cmMakeReverseIterator(entryEnd); + auto rbegin = cmMakeReverseIterator(entryEnd); rbegin = std::find(rbegin, content.rend(), cmPropertySentinal); - std::vector<cmListFileBacktrace>::const_iterator it = - backtraces.begin() + std::distance(content.begin(), rbegin.base()); + auto it = backtraces.begin() + std::distance(content.begin(), rbegin.base()); - std::vector<cmListFileBacktrace>::const_iterator end = backtraces.end(); + auto end = backtraces.end(); return cmMakeRange(it, end); } @@ -271,22 +266,17 @@ void cmStateDirectory::AppendIncludeDirectoriesEntry( void cmStateDirectory::PrependIncludeDirectoriesEntry( const std::string& vec, const cmListFileBacktrace& lfbt) { - std::vector<std::string>::iterator entryEnd = - this->DirectoryState->IncludeDirectories.begin() + + auto entryEnd = this->DirectoryState->IncludeDirectories.begin() + this->Snapshot_.Position->IncludeDirectoryPosition; - std::vector<std::string>::reverse_iterator rend = - this->DirectoryState->IncludeDirectories.rend(); - std::vector<std::string>::reverse_iterator rbegin = - cmMakeReverseIterator(entryEnd); + auto rend = this->DirectoryState->IncludeDirectories.rend(); + auto rbegin = cmMakeReverseIterator(entryEnd); rbegin = std::find(rbegin, rend, cmPropertySentinal); - std::vector<std::string>::iterator entryIt = rbegin.base(); - std::vector<std::string>::iterator entryBegin = - this->DirectoryState->IncludeDirectories.begin(); + auto entryIt = rbegin.base(); + auto entryBegin = this->DirectoryState->IncludeDirectories.begin(); - std::vector<cmListFileBacktrace>::iterator btIt = - this->DirectoryState->IncludeDirectoryBacktraces.begin() + + auto btIt = this->DirectoryState->IncludeDirectoryBacktraces.begin() + std::distance(entryBegin, entryIt); this->DirectoryState->IncludeDirectories.insert(entryIt, vec); @@ -446,22 +436,17 @@ void cmStateDirectory::AppendLinkDirectoriesEntry( void cmStateDirectory::PrependLinkDirectoriesEntry( const std::string& vec, const cmListFileBacktrace& lfbt) { - std::vector<std::string>::iterator entryEnd = - this->DirectoryState->LinkDirectories.begin() + + auto entryEnd = this->DirectoryState->LinkDirectories.begin() + this->Snapshot_.Position->LinkDirectoriesPosition; - std::vector<std::string>::reverse_iterator rend = - this->DirectoryState->LinkDirectories.rend(); - std::vector<std::string>::reverse_iterator rbegin = - cmMakeReverseIterator(entryEnd); + auto rend = this->DirectoryState->LinkDirectories.rend(); + auto rbegin = cmMakeReverseIterator(entryEnd); rbegin = std::find(rbegin, rend, cmPropertySentinal); - std::vector<std::string>::iterator entryIt = rbegin.base(); - std::vector<std::string>::iterator entryBegin = - this->DirectoryState->LinkDirectories.begin(); + auto entryIt = rbegin.base(); + auto entryBegin = this->DirectoryState->LinkDirectories.begin(); - std::vector<cmListFileBacktrace>::iterator btIt = - this->DirectoryState->LinkDirectoriesBacktraces.begin() + + auto btIt = this->DirectoryState->LinkDirectoriesBacktraces.begin() + std::distance(entryBegin, entryIt); this->DirectoryState->LinkDirectories.insert(entryIt, vec); |