diff options
author | Zachary Turner <zturner@google.com> | 2016-10-05 23:40:23 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-10-05 23:40:23 +0000 |
commit | 97d2c4011b9ccdfb9da2c5d4cb6917c9a2a18225 (patch) | |
tree | 73b9e3ce319cf6ece6d441bc75611363d81e1d30 /lldb/source/Commands/CommandObjectCommands.cpp | |
parent | 3b564e97655e0eb732219d5a4dec6c31a34f7aa9 (diff) | |
download | bcm5719-llvm-97d2c4011b9ccdfb9da2c5d4cb6917c9a2a18225.tar.gz bcm5719-llvm-97d2c4011b9ccdfb9da2c5d4cb6917c9a2a18225.zip |
Convert some Args index-based iteration to range-style iteration.
This is better for a number of reasons. Mostly style, but also:
1) Signed-unsigned comparison warnings disappear since there is
no loop index.
2) Iterating with the range-for style gives you back an entry
that has more than just a const char*, so it's more efficient
and more useful.
3) Makes code safter since the type system enforces that it's
impossible to index out of bounds.
llvm-svn: 283413
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index abf2c745490..3df7fb75627 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -1096,10 +1096,9 @@ protected: result.SetStatus(eReturnStatusSuccessFinishNoResult); } } else { - for (size_t arg_idx = 1; arg_idx < argc; ++arg_idx) { - llvm::StringRef arg_strref(command.GetArgumentAtIndex(arg_idx)); + for (auto &entry : command.entries().drop_front()) { bool check_only = false; - error = AppendRegexSubstitution(arg_strref, check_only); + error = AppendRegexSubstitution(entry.ref, check_only); if (error.Fail()) break; } |