We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd826d6 commit dd17cf4Copy full SHA for dd17cf4
lldb/include/lldb/Interpreter/CommandObject.h
@@ -40,14 +40,13 @@ int AddNamesMatchingPartialString(
40
StringList *descriptions = nullptr) {
41
int number_added = 0;
42
43
- const bool add_all = cmd_str.empty();
44
-
45
- for (auto iter = in_map.begin(), end = in_map.end(); iter != end; iter++) {
46
- if (add_all || (iter->first.find(std::string(cmd_str), 0) == 0)) {
+ for (const auto &[name, cmd] : in_map) {
+ llvm::StringRef cmd_name = name;
+ if (cmd_name.starts_with(cmd_str)) {
47
++number_added;
48
- matches.AppendString(iter->first.c_str());
+ matches.AppendString(name);
49
if (descriptions)
50
- descriptions->AppendString(iter->second->GetHelp());
+ descriptions->AppendString(cmd->GetHelp());
51
}
52
53
0 commit comments