Skip to content

Commit a3676ed

Browse files
committed
Simplify the loop in layout
1 parent 2ecc51c commit a3676ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/utils/TableGen/Basic/SequenceToOffsetTable.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,12 @@ class SequenceToOffsetTable {
116116
for (typename SeqMap::iterator I = Seqs.begin(), E = Seqs.end(); I != E;
117117
++I) {
118118
I->second = Entries;
119-
// Include space for a terminator.
120-
Entries += I->first.size() + Terminator.has_value();
119+
Entries += I->first.size();
121120
}
121+
122+
// Include space for terminators.
123+
if (Terminator)
124+
Entries += Seqs.size();
122125
}
123126

124127
/// get - Returns the offset of Seq in the final table.

0 commit comments

Comments
 (0)