소스 검색

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

Stephen Kelly 10 년 전
부모
커밋
8c74a41ff3
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      Source/cmRST.cxx

+ 6 - 2
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());
 }