aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-08-28 12:43:35 -0600
committerTom Tromey <tromey@adacore.com>2023-08-29 13:36:55 -0600
commit21bdf43aa282d25ceb462099caee5693192a8fda (patch)
treeedc34aa59abd1090d461c53e5e27259710a2adae
parent9c00ec6fe09c01df6d30fd67c3b12ee99394ee71 (diff)
downloadgdb-21bdf43aa282d25ceb462099caee5693192a8fda.zip
gdb-21bdf43aa282d25ceb462099caee5693192a8fda.tar.gz
gdb-21bdf43aa282d25ceb462099caee5693192a8fda.tar.bz2
Remove redundant variable from array_operation::evaluate
In array_operation::evaluate, 'idx' and 'tem' are redundant in one branch. This patch merges them, using the clearer name. Reviewed-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
-rw-r--r--gdb/eval.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 6cf7254..710506e 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2464,14 +2464,13 @@ array_operation::evaluate (struct type *expect_type,
if (!get_discrete_bounds (element_type, &low_bound, &high_bound))
error (_("(power)set type with unknown size"));
memset (valaddr, '\0', type->length ());
- int idx = 0;
- for (int tem = 0; tem < nargs; tem++)
+ for (int idx = 0; idx < nargs; idx++)
{
LONGEST range_low, range_high;
struct type *range_low_type, *range_high_type;
struct value *elem_val;
- elem_val = in_args[idx++]->evaluate (element_type, exp, noside);
+ elem_val = in_args[idx]->evaluate (element_type, exp, noside);
range_low_type = range_high_type = elem_val->type ();
range_low = range_high = value_as_long (elem_val);