Skip to content

Commit 022af38

Browse files
committed
Refactor: Replace starts_with("_") with hasUnderscoreNaming()
1 parent c690fef commit 022af38

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/TypeCheckNameLookup.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ unsigned TypeChecker::getCallEditDistance(DeclNameRef writtenName,
553553

554554
// Don't typo-correct to a name with a leading underscore unless the typed
555555
// name also begins with an underscore.
556-
if (correctedBase.starts_with("_") && !writtenBase.starts_with("_")) {
556+
if (correctedName.getBaseIdentifier().hasUnderscoredNaming() &&
557+
!writtenName.getBaseIdentifier().hasUnderscoredNaming()) {
557558
return UnreasonableCallEditDistance;
558559
}
559560

0 commit comments

Comments
 (0)