diff options
Diffstat (limited to 'Source/cmStateDirectory.cxx')
-rw-r--r-- | Source/cmStateDirectory.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 6752743..15c8a61 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -8,6 +8,7 @@ #include <iterator> #include <utility> +#include "cmAlgorithms.h" #include "cmProperty.h" #include "cmPropertyMap.h" #include "cmState.h" @@ -40,9 +41,8 @@ void cmStateDirectory::ComputeRelativePathTopSource() std::string result = snapshots.front().GetDirectory().GetCurrentSource(); - for (std::vector<cmStateSnapshot>::const_iterator it = snapshots.begin() + 1; - it != snapshots.end(); ++it) { - std::string currentSource = it->GetDirectory().GetCurrentSource(); + for (cmStateSnapshot const& snp : cmMakeRange(snapshots).advance(1)) { + std::string currentSource = snp.GetDirectory().GetCurrentSource(); if (cmSystemTools::IsSubDirectory(result, currentSource)) { result = currentSource; } @@ -66,9 +66,8 @@ void cmStateDirectory::ComputeRelativePathTopBinary() std::string result = snapshots.front().GetDirectory().GetCurrentBinary(); - for (std::vector<cmStateSnapshot>::const_iterator it = snapshots.begin() + 1; - it != snapshots.end(); ++it) { - std::string currentBinary = it->GetDirectory().GetCurrentBinary(); + for (cmStateSnapshot const& snp : cmMakeRange(snapshots).advance(1)) { + std::string currentBinary = snp.GetDirectory().GetCurrentBinary(); if (cmSystemTools::IsSubDirectory(result, currentBinary)) { result = currentBinary; } |