diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-11-25 15:03:46 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-11-25 15:03:46 +0100 |
| commit | d1782133d96d316c3bc98e33a191994794a26851 (patch) | |
| tree | b34395755e063b8df5d970569a6d8421d78e9d64 /lldb/source/Symbol/Block.cpp | |
| parent | d9c9a4e48d286a04d09a8fdea87f486a9ec02cd0 (diff) | |
| download | bcm5719-llvm-d1782133d96d316c3bc98e33a191994794a26851.tar.gz bcm5719-llvm-d1782133d96d316c3bc98e33a191994794a26851.zip | |
[lldb][NFC] Allow range-based for-loops on VariableList
Summary:
Adds support for doing range-based for-loops on LLDB's VariableList and
modernises all the index-based for-loops in LLDB where possible.
Reviewers: labath, jdoerfert
Reviewed By: labath
Subscribers: JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70668
Diffstat (limited to 'lldb/source/Symbol/Block.cpp')
| -rw-r--r-- | lldb/source/Symbol/Block.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Symbol/Block.cpp b/lldb/source/Symbol/Block.cpp index 77a4830dea7..dad52c6502a 100644 --- a/lldb/source/Symbol/Block.cpp +++ b/lldb/source/Symbol/Block.cpp @@ -406,11 +406,10 @@ Block::AppendBlockVariables(bool can_create, bool get_child_block_variables, uint32_t num_variables_added = 0; VariableList *block_var_list = GetBlockVariableList(can_create).get(); if (block_var_list) { - for (size_t i = 0; i < block_var_list->GetSize(); ++i) { - VariableSP variable = block_var_list->GetVariableAtIndex(i); - if (filter(variable.get())) { + for (const VariableSP &var_sp : *block_var_list) { + if (filter(var_sp.get())) { num_variables_added++; - variable_list->AddVariable(variable); + variable_list->AddVariable(var_sp); } } } |

