mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NFC][StringExtras] Use llvm::StringSwitch in canBeArgumentLabel as with canBeMemberName
This commit is contained in:
@@ -29,11 +29,12 @@ using namespace swift;
|
||||
using namespace camel_case;
|
||||
|
||||
bool swift::canBeArgumentLabel(StringRef identifier) {
|
||||
if (identifier == "var" || identifier == "let" || identifier == "inout" ||
|
||||
identifier == "$")
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return llvm::StringSwitch<bool>(identifier)
|
||||
.Case("var", false)
|
||||
.Case("let", false)
|
||||
.Case("inout", false)
|
||||
.Case("$", false)
|
||||
.Default(true);
|
||||
}
|
||||
|
||||
bool swift::canBeMemberName(StringRef identifier) {
|
||||
|
||||
Reference in New Issue
Block a user