mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Omit needless words: don't drop the first argument label in initializers.
While there are cases where it makes sense to drop the first argument label in initializers---when they're primarily conversions---it's an heuristic that produces poor results (e.g., init(_:) rather than init(coder:)) more often than not. Thus, remove this heuristic. Swift SVN r31626
This commit is contained in:
@@ -339,11 +339,7 @@ StringRef swift::omitNeedlessWords(StringRef name, StringRef typeName,
|
||||
|
||||
// Handle complete name matches.
|
||||
if (nameWordRevIter == nameWordRevIterEnd) {
|
||||
// If this is the first parameter, it's okay to drop the name
|
||||
// entirely.
|
||||
if (role == NameRole::FirstParameter) return "";
|
||||
|
||||
// Otherwise, leave the name alone.
|
||||
// Leave the name alone.
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user