Skip to content

Commit 79ce05e

Browse files
committed
Adjusting a variable name to not shadow and making a few variables 'const'.
1 parent 058f0bb commit 79ce05e

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lldb/tools/lldb-dap/Handler/VariablesRequestHandler.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ namespace lldb_dap {
2323
/// indexed children.
2424
Expected<VariablesResponseBody>
2525
VariablesRequestHandler::Run(const VariablesArguments &arguments) const {
26-
uint64_t var_ref = arguments.variablesReference;
27-
uint64_t count = arguments.count;
28-
uint64_t start = arguments.start;
26+
const uint64_t var_ref = arguments.variablesReference;
27+
const uint64_t count = arguments.count;
28+
const uint64_t start = arguments.start;
2929
bool hex = false;
3030
if (arguments.format)
3131
hex = arguments.format->hex;
@@ -135,16 +135,18 @@ VariablesRequestHandler::Run(const VariablesArguments &arguments) const {
135135
// children.
136136
lldb::SBValue variable = dap.variables.GetVariable(var_ref);
137137
if (variable.IsValid()) {
138+
bool is_permanent = dap.variables.IsPermanentVariableReference(var_ref);
138139
auto addChild = [&](lldb::SBValue child,
139140
std::optional<std::string> custom_name = {}) {
140141
if (!child.IsValid())
141142
return;
142-
bool is_permanent = dap.variables.IsPermanentVariableReference(var_ref);
143-
int64_t var_ref = dap.variables.InsertVariable(child, is_permanent);
144-
variables.emplace_back(CreateVariable(
145-
child, var_ref, hex, dap.configuration.enableAutoVariableSummaries,
146-
dap.configuration.enableSyntheticChildDebugging,
147-
/*is_name_duplicated=*/false, custom_name));
143+
int64_t child_var_ref =
144+
dap.variables.InsertVariable(child, is_permanent);
145+
variables.emplace_back(
146+
CreateVariable(child, child_var_ref, hex,
147+
dap.configuration.enableAutoVariableSummaries,
148+
dap.configuration.enableSyntheticChildDebugging,
149+
/*is_name_duplicated=*/false, custom_name));
148150
};
149151
const int64_t num_children = variable.GetNumChildren();
150152
int64_t end_idx = start + ((count == 0) ? num_children : count);

0 commit comments

Comments
 (0)