[clang-tidy] Don't index past the end of a vector.

We actually want the end iterator so just replace it with iterator arithmetic.

llvm-svn: 215195
This commit is contained in:
Benjamin Kramer 2014-08-08 10:43:11 +00:00
parent 35837ac9a9
commit b41c91c389
1 changed files with 2 additions and 1 deletions

View File

@ -107,7 +107,8 @@ void IncludeOrderPPCallbacks::EndOfMainFile() {
// Sort the includes. We first sort by priority, then lexicographically.
for (unsigned BI = 0, BE = Blocks.size() - 1; BI != BE; ++BI)
std::sort(&IncludeIndices[Blocks[BI]], &IncludeIndices[Blocks[BI + 1]],
std::sort(IncludeIndices.begin() + Blocks[BI],
IncludeIndices.begin() + Blocks[BI + 1],
[this](unsigned LHSI, unsigned RHSI) {
IncludeDirective &LHS = IncludeDirectives[LHSI];
IncludeDirective &RHS = IncludeDirectives[RHSI];