cmRST: Replace two erase with a rotate and larger erase.

This commit is contained in:
Stephen Kelly 2015-01-30 00:03:24 +01:00
parent 61fe1919de
commit 8c74a41ff3
1 changed files with 6 additions and 2 deletions

View File

@ -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());
}