Skip to content

Commit 7ca4079

Browse files
[TargetParser] Use StringRef::consume_back (NFC) (#139416)
1 parent 9a9a78e commit 7ca4079

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/TargetParser/ARMTargetParserCommon.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ StringRef ARM::getCanonicalArchName(StringRef Arch) {
8282
// Ex. "armebv7", move past the "eb".
8383
if (offset != StringRef::npos && A.substr(offset, 2) == "eb")
8484
offset += 2;
85-
// Or, if it ends with eb ("armv7eb"), chop it off.
86-
else if (A.ends_with("eb"))
87-
A = A.substr(0, A.size() - 2);
85+
else
86+
// Or, if it ends with eb ("armv7eb"), chop it off.
87+
A.consume_back("eb");
8888
// Trim the head
8989
if (offset != StringRef::npos)
9090
A = A.substr(offset);

0 commit comments

Comments
 (0)