Skip to content

Commit 5eed019

Browse files
committed
[TableGen] Use std::copy instead of a manual copy loop. NFC
1 parent c7dc836 commit 5eed019

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

llvm/utils/TableGen/DAGISelMatcherOpt.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,8 @@ static void FactorScope(std::unique_ptr<Matcher> &MatcherPtr) {
306306

307307
// If we removed any equal matchers, we may need to slide the rest of the
308308
// elements down for the next iteration of the outer loop.
309-
if (J != K) {
310-
while (J != E)
311-
*K++ = *J++;
312-
313-
// Update end pointer for outer loop.
314-
E = K;
315-
}
309+
if (J != K)
310+
E = std::copy(J, E, K);
316311

317312
// If we only found one option starting with this matcher, no factoring is
318313
// possible. Put the Matcher back in OptionsToMatch.

0 commit comments

Comments
 (0)