Skip to content

Commit bb6564a

Browse files
[TableGen] Use StringRef::consume_front (NFC)
1 parent f523a55 commit bb6564a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/utils/TableGen/GlobalISel/CodeExpander.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ void CodeExpander::emit(raw_ostream &OS) const {
3131
OS << Current.substr(0, Pos);
3232
Current = Current.substr(Pos);
3333

34-
if (Current.starts_with("\n")) {
34+
if (Current.consume_front("\n")) {
3535
OS << "\n" << Indent;
36-
Current = Current.drop_front(1);
3736
continue;
3837
}
3938

@@ -43,10 +42,8 @@ void CodeExpander::emit(raw_ostream &OS) const {
4342
continue;
4443
}
4544

46-
if (Current.starts_with("\\")) {
47-
Current = Current.drop_front(1);
45+
if (Current.consume_front("\\"))
4846
continue;
49-
}
5047

5148
if (Current.starts_with("${")) {
5249
StringRef StartVar = Current;

0 commit comments

Comments
 (0)