Skip to content

Commit 20984d8

Browse files
[Driver] Use StringRef::consume_back (NFC) (llvm#139478)
1 parent e584af5 commit 20984d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,8 +1411,8 @@ StringRef Darwin::getSDKName(StringRef isysroot) {
14111411
auto EndSDK = llvm::sys::path::rend(isysroot);
14121412
for (auto IT = BeginSDK; IT != EndSDK; ++IT) {
14131413
StringRef SDK = *IT;
1414-
if (SDK.ends_with(".sdk"))
1415-
return SDK.slice(0, SDK.size() - 4);
1414+
if (SDK.consume_back(".sdk"))
1415+
return SDK;
14161416
}
14171417
return "";
14181418
}

0 commit comments

Comments
 (0)