summaryrefslogtreecommitdiffstats
path: root/Source/cmRST.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-29 23:03:24 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-20 20:36:58 (GMT)
commit8c74a41ff3b6fce1bb7d088d16f5e0a9ae8ab55d (patch)
tree0edc63dfd64c2db0a9761b205fa0dcc9c4ed9ff3 /Source/cmRST.cxx
parent61fe1919de8c0455a6baff543ccfcb35fce8f37b (diff)
downloadCMake-8c74a41ff3b6fce1bb7d088d16f5e0a9ae8ab55d.zip
CMake-8c74a41ff3b6fce1bb7d088d16f5e0a9ae8ab55d.tar.gz
CMake-8c74a41ff3b6fce1bb7d088d16f5e0a9ae8ab55d.tar.bz2
cmRST: Replace two erase with a rotate and larger erase.
Diffstat (limited to 'Source/cmRST.cxx')
-rw-r--r--Source/cmRST.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index 14e8ad9..c261d57 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -497,6 +497,10 @@ void cmRST::UnindentLines(std::vector<std::string>& lines)
{
++trailingEmpty;
}
- lines.erase(lines.begin(), lines.begin()+leadingEmpty);
- lines.erase(lines.end()-trailingEmpty, lines.end());
+
+ std::vector<std::string>::iterator contentEnd
+ = cmRotate(lines.begin(),
+ lines.begin() + leadingEmpty,
+ lines.end() - trailingEmpty);
+ lines.erase(contentEnd, lines.end());
}