[Driver] Use StringRef::consume_back (NFC) (#139478)
This commit is contained in:
parent
e584af5861
commit
20984d841d
@ -1411,8 +1411,8 @@ StringRef Darwin::getSDKName(StringRef isysroot) {
|
||||
auto EndSDK = llvm::sys::path::rend(isysroot);
|
||||
for (auto IT = BeginSDK; IT != EndSDK; ++IT) {
|
||||
StringRef SDK = *IT;
|
||||
if (SDK.ends_with(".sdk"))
|
||||
return SDK.slice(0, SDK.size() - 4);
|
||||
if (SDK.consume_back(".sdk"))
|
||||
return SDK;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user