mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[omit-needless-words] Fix a bug found by -Wunused-result
StringRef::drop_back() returns the new string; it doesn't mutate `this`.
This commit is contained in:
@@ -669,7 +669,7 @@ static StringRef omitNeedlessWords(StringRef name,
|
||||
NameRole::Partial, allPropertyNames, scratch);
|
||||
if (shortenedNameWord == newShortenedNameWord &&
|
||||
shortenedNameWord.back() == 'e') {
|
||||
shortenedNameWord.drop_back();
|
||||
shortenedNameWord = shortenedNameWord.drop_back();
|
||||
newShortenedNameWord =
|
||||
omitNeedlessWords(shortenedNameWord, typeName.CollectionElement,
|
||||
NameRole::Partial, allPropertyNames, scratch);
|
||||
|
||||
Reference in New Issue
Block a user