diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-12-18 20:30:12 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2024-04-06 20:11:55 +0000 |
| commit | 5f757f3ff9144b609b3c433dfd370cc6bdc191ad (patch) | |
| tree | 1b4e980b866cd26a00af34c0a653eb640bd09caf /contrib/llvm-project/lldb/source/Interpreter/Options.cpp | |
| parent | 3e1c8a35f741a5d114d0ba670b15191355711fe9 (diff) | |
| parent | 312c0ed19cc5276a17bacf2120097bec4515b0f1 (diff) | |
Diffstat (limited to 'contrib/llvm-project/lldb/source/Interpreter/Options.cpp')
| -rw-r--r-- | contrib/llvm-project/lldb/source/Interpreter/Options.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/llvm-project/lldb/source/Interpreter/Options.cpp b/contrib/llvm-project/lldb/source/Interpreter/Options.cpp index acbde7660440..89fe69009d90 100644 --- a/contrib/llvm-project/lldb/source/Interpreter/Options.cpp +++ b/contrib/llvm-project/lldb/source/Interpreter/Options.cpp @@ -636,7 +636,7 @@ bool Options::HandleOptionCompletion(CompletionRequest &request, // upper level code will know this is a full match and add the " ". const OptionDefinition &opt = opt_defs[opt_defs_index]; llvm::StringRef long_option = opt.long_option; - if (cur_opt_str.startswith("--") && cur_opt_str != long_option) { + if (cur_opt_str.starts_with("--") && cur_opt_str != long_option) { request.AddCompletion("--" + long_option.str(), opt.usage_text); return true; } else @@ -652,7 +652,7 @@ bool Options::HandleOptionCompletion(CompletionRequest &request, if (cur_opt_str.consume_front("--")) { for (auto &def : opt_defs) { llvm::StringRef long_option(def.long_option); - if (long_option.startswith(cur_opt_str)) + if (long_option.starts_with(cur_opt_str)) request.AddCompletion("--" + long_option.str(), def.usage_text); } } @@ -890,8 +890,8 @@ static size_t FindArgumentIndexForOption(const Args &args, std::string long_opt = std::string(llvm::formatv("--{0}", long_option.definition->long_option)); for (const auto &entry : llvm::enumerate(args)) { - if (entry.value().ref().startswith(short_opt) || - entry.value().ref().startswith(long_opt)) + if (entry.value().ref().starts_with(short_opt) || + entry.value().ref().starts_with(long_opt)) return entry.index(); } |
