Skip to content

Commit 46ad660

Browse files
author
David Ungar
committed
untested minor refact
1 parent 468a23c commit 46ad660

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/Driver/SourceComparator.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,13 @@ SourceComparator::buildEquivalenceClasses() {
7777

7878
SourceComparator::PRLink *SourceComparator::newPRLink(LineIndices lines,
7979
PRLink *next) {
80+
if (nextLink >= linkVec.size())
81+
linkVec.emplace_back();
8082
assert(nextLink < linkVec.size());
81-
linkVec[nextLink].lines = lines;
82-
linkVec[nextLink].next = next;
83-
return &linkVec[nextLink++];
83+
PRLink &link = linkVec[nextLink++];
84+
link.lines = lines;
85+
link.next = next;
86+
return &link;
8487
}
8588

8689
std::pair<std::vector<SourceComparator::PRLink *>,

0 commit comments

Comments
 (0)