mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -78,7 +78,7 @@ private:
|
||||
static StringRef getTagForDecl(const Decl *D, bool isRef) {
|
||||
auto UID = SwiftLangSupport::getUIDForDecl(D, isRef);
|
||||
static const char *prefix = "source.lang.swift.";
|
||||
assert(UID.getName().startswith(prefix));
|
||||
assert(UID.getName().starts_with(prefix));
|
||||
return UID.getName().drop_front(strlen(prefix));
|
||||
}
|
||||
|
||||
@@ -2344,7 +2344,7 @@ static void resolveCursorFromUSR(
|
||||
void handlePrimaryAST(ASTUnitRef AstUnit) override {
|
||||
auto &CompIns = AstUnit->getCompilerInstance();
|
||||
|
||||
if (USR.startswith("c:")) {
|
||||
if (USR.starts_with("c:")) {
|
||||
LOG_WARN_FUNC("lookup for C/C++/ObjC USRs not implemented");
|
||||
CursorInfoData Info;
|
||||
Info.InternalDiagnostic = "Lookup for C/C++/ObjC USRs not implemented.";
|
||||
|
||||
Reference in New Issue
Block a user