diff options
| author | Zachary Turner <zturner@google.com> | 2016-12-09 05:46:41 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2016-12-09 05:46:41 +0000 |
| commit | 2c84f908afc851a1ba83c6a8471a62db81475ef8 (patch) | |
| tree | d51372b98dfbb090aafdab5dc233b32f790981d3 /lldb/source/Commands/CommandObjectPlugin.cpp | |
| parent | 8db7e5e4eed4c4e697dc3164f2c9351d8c3e942b (diff) | |
| download | bcm5719-llvm-2c84f908afc851a1ba83c6a8471a62db81475ef8.tar.gz bcm5719-llvm-2c84f908afc851a1ba83c6a8471a62db81475ef8.zip | |
Remove some more uses of Args::GetArgumentAtIndex.
llvm-svn: 289188
Diffstat (limited to 'lldb/source/Commands/CommandObjectPlugin.cpp')
| -rw-r--r-- | lldb/source/Commands/CommandObjectPlugin.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectPlugin.cpp b/lldb/source/Commands/CommandObjectPlugin.cpp index 598b5da4a53..7ae968b95fc 100644 --- a/lldb/source/Commands/CommandObjectPlugin.cpp +++ b/lldb/source/Commands/CommandObjectPlugin.cpp @@ -48,12 +48,12 @@ public: int match_start_point, int max_return_elements, bool &word_complete, StringList &matches) override { - std::string completion_str(input.GetArgumentAtIndex(cursor_index)); - completion_str.erase(cursor_char_position); + auto completion_str = input[cursor_index].ref; + completion_str = completion_str.take_front(cursor_char_position); CommandCompletions::InvokeCommonCompletionCallbacks( GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion, - completion_str.c_str(), match_start_point, max_return_elements, nullptr, + completion_str, match_start_point, max_return_elements, nullptr, word_complete, matches); return matches.GetSize(); } @@ -68,11 +68,9 @@ protected: return false; } - const char *path = command.GetArgumentAtIndex(0); - Error error; - FileSpec dylib_fspec(path, true); + FileSpec dylib_fspec(command[0].ref, true); if (m_interpreter.GetDebugger().LoadPlugin(dylib_fspec, error)) result.SetStatus(eReturnStatusSuccessFinishResult); |

