@@ -69,7 +69,7 @@ PartOfSpeech swift::getPartOfSpeech(StringRef word) {
6969#include " PartsOfSpeech.def"
7070
7171 // Identify gerunds, which always end in "ing".
72- if (word.endswith (" ing" ) && word.size () > 4 ) {
72+ if (word.ends_with (" ing" ) && word.size () > 4 ) {
7373 StringRef possibleVerb = word.drop_back (3 );
7474
7575 // If what remains is a verb, we have a gerund.
@@ -417,7 +417,7 @@ static std::optional<StringRef> skipTypeSuffix(StringRef typeName) {
417417 }
418418
419419 // _t.
420- if (typeName.size () > 2 && typeName.endswith (" _t" )) {
420+ if (typeName.size () > 2 && typeName.ends_with (" _t" )) {
421421 return typeName.drop_back (2 );
422422 }
423423 return std::nullopt ;
@@ -555,7 +555,7 @@ static StringRef omitNeedlessWordsFromPrefix(StringRef name,
555555 if (firstWord == " By" ) {
556556 StringRef nextWord = camel_case::getFirstWord (
557557 newName.substr (firstWord.size ()));
558- if (nextWord.endswith (" ing" )) {
558+ if (nextWord.ends_with (" ing" )) {
559559 return newName.substr (firstWord.size ());
560560 }
561561 }
@@ -1404,27 +1404,27 @@ bool swift::omitNeedlessWords(
14041404
14051405std::optional<StringRef>
14061406swift::stripWithCompletionHandlerSuffix (StringRef name) {
1407- if (name.endswith (" WithCompletionHandler" )) {
1407+ if (name.ends_with (" WithCompletionHandler" )) {
14081408 return name.drop_back (strlen (" WithCompletionHandler" ));
14091409 }
14101410
1411- if (name.endswith (" WithCompletion" )) {
1411+ if (name.ends_with (" WithCompletion" )) {
14121412 return name.drop_back (strlen (" WithCompletion" ));
14131413 }
14141414
1415- if (name.endswith (" WithCompletionBlock" )) {
1415+ if (name.ends_with (" WithCompletionBlock" )) {
14161416 return name.drop_back (strlen (" WithCompletionBlock" ));
14171417 }
14181418
1419- if (name.endswith (" WithBlock" )) {
1419+ if (name.ends_with (" WithBlock" )) {
14201420 return name.drop_back (strlen (" WithBlock" ));
14211421 }
14221422
1423- if (name.endswith (" WithReplyTo" )) {
1423+ if (name.ends_with (" WithReplyTo" )) {
14241424 return name.drop_back (strlen (" WithReplyTo" ));
14251425 }
14261426
1427- if (name.endswith (" WithReply" )) {
1427+ if (name.ends_with (" WithReply" )) {
14281428 return name.drop_back (strlen (" WithReply" ));
14291429 }
14301430
0 commit comments