diff options
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); |