mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NFC] updating StringRef API
`StringRef::endswith_insensitive` and `StringRef::startswith_insensitive` is deprecated and being replaced with `StringRef::ends_with_insensitive` and `StringRef::starts_with_insensitive` respectively.
This commit is contained in:
@@ -398,7 +398,7 @@ static bool matchNameWordToTypeWord(StringRef nameWord, StringRef typeWord) {
|
||||
// We can match the suffix of the type so long as everything preceding the
|
||||
// match is neither a lowercase letter nor a '_'. This ignores type
|
||||
// prefixes for acronyms, e.g., the 'NS' in 'NSURL'.
|
||||
if (typeWord.endswith_insensitive(nameWord) &&
|
||||
if (typeWord.ends_with_insensitive(nameWord) &&
|
||||
!clang::isLowercase(typeWord[typeWord.size() - nameWord.size()])) {
|
||||
// Check that everything preceding the match is neither a lowercase letter
|
||||
// nor a '_'.
|
||||
@@ -411,7 +411,7 @@ static bool matchNameWordToTypeWord(StringRef nameWord, StringRef typeWord) {
|
||||
|
||||
// We can match a prefix so long as everything following the match is
|
||||
// a number.
|
||||
if (typeWord.startswith_insensitive(nameWord)) {
|
||||
if (typeWord.starts_with_insensitive(nameWord)) {
|
||||
for (unsigned i = nameWord.size(), n = typeWord.size(); i != n; ++i) {
|
||||
if (!clang::isDigit(typeWord[i])) return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user