From 8c74a41ff3b6fce1bb7d088d16f5e0a9ae8ab55d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 30 Jan 2015 00:03:24 +0100 Subject: [PATCH] cmRST: Replace two erase with a rotate and larger erase. --- Source/cmRST.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 14e8ad952..c261d5796 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -497,6 +497,10 @@ void cmRST::UnindentLines(std::vector& lines) { ++trailingEmpty; } - lines.erase(lines.begin(), lines.begin()+leadingEmpty); - lines.erase(lines.end()-trailingEmpty, lines.end()); + + std::vector::iterator contentEnd + = cmRotate(lines.begin(), + lines.begin() + leadingEmpty, + lines.end() - trailingEmpty); + lines.erase(contentEnd, lines.end()); }