[lldb][NFC] Simplify regex_chars in CommandCompletions
authorRaphael Isemann <teemperor@gmail.com>
Fri, 29 Nov 2019 11:26:33 +0000 (12:26 +0100)
committerRaphael Isemann <teemperor@gmail.com>
Fri, 29 Nov 2019 11:34:23 +0000 (12:34 +0100)
lldb/source/Commands/CommandCompletions.cpp

index d325b72..b382e26 100644 (file)
@@ -413,10 +413,7 @@ void CommandCompletions::SourceFileCompleter::DoCompletion(
 // SymbolCompleter
 
 static bool regex_chars(const char comp) {
-  return (comp == '[' || comp == ']' || comp == '(' || comp == ')' ||
-          comp == '{' || comp == '}' || comp == '+' || comp == '.' ||
-          comp == '*' || comp == '|' || comp == '^' || comp == '$' ||
-          comp == '\\' || comp == '?');
+  return llvm::StringRef("[](){}+.*|^$\\?").contains(comp);
 }
 
 CommandCompletions::SymbolCompleter::SymbolCompleter(