llvm.org GIT mirror llvm / 36fc59c
[TableGen] Use vector::append instead of looping and calling push_back. NFC Both vectors contain unsigned so we can just use append to do the copying. Not only is this shorter, but it should be able to predict the final size and only grow the vector once if needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328033 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 2 years ago
1 changed file(s) with 2 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
14191419 unsigned Idx = LastTransitions[0].WriteSequences.size();
14201420 LastTransitions[0].WriteSequences.resize(Idx + 1);
14211421 SmallVectorImpl &Seq = LastTransitions[0].WriteSequences[Idx];
1422 for (IdxIter WI = WriteSeq.begin(), WE = WriteSeq.end(); WI != WE; ++WI)
1423 Seq.push_back(*WI);
1422 Seq.append(WriteSeq.begin(), WriteSeq.end());
14241423 DEBUG(dbgs() << "("; dumpIdxVec(Seq); dbgs() << ") ");
14251424 }
14261425 DEBUG(dbgs() << " Reads: ");
14301429 unsigned Idx = LastTransitions[0].ReadSequences.size();
14311430 LastTransitions[0].ReadSequences.resize(Idx + 1);
14321431 SmallVectorImpl &Seq = LastTransitions[0].ReadSequences[Idx];
1433 for (IdxIter RI = ReadSeq.begin(), RE = ReadSeq.end(); RI != RE; ++RI)
1434 Seq.push_back(*RI);
1432 Seq.append(ReadSeq.begin(), ReadSeq.end());
14351433 DEBUG(dbgs() << "("; dumpIdxVec(Seq); dbgs() << ") ");
14361434 }
14371435 DEBUG(dbgs() << '\n');