summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectSettings.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-10-05 23:40:23 +0000
committerZachary Turner <zturner@google.com>2016-10-05 23:40:23 +0000
commit97d2c4011b9ccdfb9da2c5d4cb6917c9a2a18225 (patch)
tree73b9e3ce319cf6ece6d441bc75611363d81e1d30 /lldb/source/Commands/CommandObjectSettings.cpp
parent3b564e97655e0eb732219d5a4dec6c31a34f7aa9 (diff)
downloadbcm5719-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/CommandObjectSettings.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectSettings.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp
index 9c7493a6b55..21a636f08dd 100644
--- a/lldb/source/Commands/CommandObjectSettings.cpp
+++ b/lldb/source/Commands/CommandObjectSettings.cpp
@@ -294,7 +294,9 @@ protected:
result.SetStatus(eReturnStatusSuccessFinishResult);
const size_t argc = args.GetArgumentCount();
- if (argc > 0) {
+ if (!args.empty()) {
+ // TODO: Convert this to StringRef based enumeration. Requires converting
+ // DumpPropertyValue first.
for (size_t i = 0; i < argc; ++i) {
const char *property_path = args.GetArgumentAtIndex(i);
@@ -374,6 +376,8 @@ protected:
if (argc > 0) {
const bool dump_qualified_name = true;
+ // TODO: Convert to StringRef based enumeration. Requires converting
+ // GetPropertyAtPath first.
for (size_t i = 0; i < argc; ++i) {
const char *property_path = args.GetArgumentAtIndex(i);
OpenPOWER on IntegriCloud