mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Rename startswith to starts_with
LLVM is presumably moving towards `std::string_view` - `StringRef::startswith` is deprecated on tip. `SmallString::startswith` was just renamed there (maybe with some small deprecation inbetween, but if so, we've missed it). The `SmallString::startswith` references were moved to `.str().starts_with()`, rather than adding the `starts_with` on `stable/20230725` as we only had a few of them. Open to switching that over if anyone feels strongly though.
This commit is contained in:
@@ -373,7 +373,7 @@ static ValidationInfo validateControlBlock(
|
||||
// recommended configuration and may lead to unreadable swiftmodules.
|
||||
StringRef moduleSDK = blobData;
|
||||
if (!moduleSDK.empty() && !requiredSDK.empty() &&
|
||||
!requiredSDK.startswith(moduleSDK)) {
|
||||
!requiredSDK.starts_with(moduleSDK)) {
|
||||
result.status = Status::SDKMismatch;
|
||||
return result;
|
||||
}
|
||||
@@ -571,7 +571,7 @@ std::string serialization::StatusToString(Status S) {
|
||||
bool serialization::isSerializedAST(StringRef data) {
|
||||
StringRef signatureStr(reinterpret_cast<const char *>(SWIFTMODULE_SIGNATURE),
|
||||
std::size(SWIFTMODULE_SIGNATURE));
|
||||
return data.startswith(signatureStr);
|
||||
return data.starts_with(signatureStr);
|
||||
}
|
||||
|
||||
ValidationInfo serialization::validateSerializedAST(
|
||||
|
||||
Reference in New Issue
Block a user