Skip to content

Commit e25609c

Browse files
committed
[Cleanup] Remove more StringRef::equals
`StringRef::equals` has been removed upstream.
1 parent 80f1d19 commit e25609c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/Parse/ParseVersion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ std::optional<Version> VersionParser::parseCompilerVersionString(
9494

9595
// The second version component isn't used for comparison.
9696
if (i == 1) {
97-
if (!SplitComponent.equals("*")) {
97+
if (SplitComponent != "*") {
9898
if (Diags) {
9999
// Majors 600-1300 were used for Swift 1.0-5.5 (based on clang
100100
// versions), but then we reset the numbering based on Swift versions,

lib/Sema/TypeCheckAttr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,7 @@ static bool allowSymbolLinkageMarkers(ASTContext &ctx, Decl *D) {
24422442

24432443
if (macroDecl->getParentModule()->isStdlibModule() &&
24442444
macroDecl->getName().getBaseIdentifier()
2445-
.str().equals("_DebugDescriptionProperty"))
2445+
.str() == "_DebugDescriptionProperty")
24462446
return true;
24472447

24482448
return false;
@@ -7366,11 +7366,11 @@ void AttributeChecker::visitUnsafeInheritExecutorAttr(
73667366
if (!fn->isAsyncContext()) {
73677367
diagnose(attr->getLocation(), diag::inherits_executor_without_async);
73687368
} else if (fn->getBaseName().isSpecial() ||
7369-
!fn->getParentModule()->getName().str().equals("_Concurrency") ||
7369+
fn->getParentModule()->getName().str() != "_Concurrency" ||
73707370
!fn->getBaseIdentifier().str()
73717371
.starts_with("_unsafeInheritExecutor_")) {
73727372
bool inConcurrencyModule = D->getDeclContext()->getParentModule()->getName()
7373-
.str().equals("_Concurrency");
7373+
.str() == "_Concurrency";
73747374
auto diag = fn->diagnose(diag::unsafe_inherits_executor_deprecated);
73757375
diag.warnUntilSwiftVersion(6);
73767376
diag.limitBehaviorIf(inConcurrencyModule, DiagnosticBehavior::Warning);

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2096,7 +2096,7 @@ void swift::replaceUnsafeInheritExecutorWithDefaultedIsolationParam(
20962096

20972097
/// Whether this declaration context is in the _Concurrency module.
20982098
static bool inConcurrencyModule(const DeclContext *dc) {
2099-
return dc->getParentModule()->getName().str().equals("_Concurrency");
2099+
return dc->getParentModule()->getName().str() == "_Concurrency";
21002100
}
21012101

21022102
void swift::introduceUnsafeInheritExecutorReplacements(

0 commit comments

Comments
 (0)