Skip to content

Commit 632f482

Browse files
committed
remove const and sort in place
1 parent 358c954 commit 632f482

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/CodeGen/MachineOutliner.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ void MachineOutliner::findCandidates(
584584
LLVM_DEBUG(dbgs() << "*** Discarding overlapping candidates *** \n");
585585
LLVM_DEBUG(
586586
dbgs() << "Searching for overlaps in all repeated sequences...\n");
587-
for (const SuffixTree::RepeatedSubstring &RS : ST) {
587+
for (SuffixTree::RepeatedSubstring &RS : ST) {
588588
CandidatesForRepeatedSeq.clear();
589589
unsigned StringLen = RS.Length;
590590
LLVM_DEBUG(dbgs() << " Sequence length: " << StringLen << "\n");
@@ -595,9 +595,8 @@ void MachineOutliner::findCandidates(
595595
#endif
596596
// Sort the start indices so that we can efficiently check if candidates
597597
// overlap with each other in MachineOutliner::findCandidates().
598-
SmallVector<unsigned> SortedStartIndices(RS.StartIndices);
599-
llvm::sort(SortedStartIndices);
600-
for (const unsigned &StartIdx : SortedStartIndices) {
598+
llvm::sort(RS.StartIndices);
599+
for (const unsigned &StartIdx : RS.StartIndices) {
601600
// Trick: Discard some candidates that would be incompatible with the
602601
// ones we've already found for this sequence. This will save us some
603602
// work in candidate selection.

0 commit comments

Comments
 (0)