Remove two unnecessary variables from evaluate_subexp_standard
authorTom Tromey <tom@tromey.com>
Wed, 25 Nov 2020 17:19:40 +0000 (10:19 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 25 Nov 2020 17:19:40 +0000 (10:19 -0700)
I noticed a couple of spots in evaluate_subexp_standard that looked
like:

    value *result;
    result = something;
    return result;

This patch simplifies these spots to a simple "return".

gdb/ChangeLog
2020-11-25  Tom Tromey  <tom@tromey.com>

* eval.c (evaluate_subexp_standard): Remove unnecessary
variables.

gdb/ChangeLog
gdb/eval.c

index 77aeb77e0d7c4171066f11459d523b94990e6af9..0379a4c2f92f2feba926ffc95f0be382eb531f88 100644 (file)
@@ -1,3 +1,8 @@
+2020-11-25  Tom Tromey  <tom@tromey.com>
+
+       * eval.c (evaluate_subexp_standard): Remove unnecessary
+       variables.
+
 2020-11-25  Tom Tromey  <tom@tromey.com>
 
        * d-lang.c: Include parser-defs.h.
index 2626ee6d8765ff07a4cbdb8b94c0e3a257171ed8..407d4b4ac59fd7eeffeb78329c82440df1d0b7b3 100644 (file)
@@ -2142,12 +2142,11 @@ evaluate_subexp_standard (struct type *expect_type,
                  || op == BINOP_MOD)
              && value_logical_not (arg2))
            {
-             struct value *v_one, *retval;
+             struct value *v_one;
 
              v_one = value_one (value_type (arg2));
              binop_promote (exp->language_defn, exp->gdbarch, &arg1, &v_one);
-             retval = value_binop (arg1, v_one, op);
-             return retval;
+             return value_binop (arg1, v_one, op);
            }
          else
            {
@@ -2532,12 +2531,7 @@ evaluate_subexp_standard (struct type *expect_type,
          return eval_skip_value (exp);
        }
       else
-       {
-         struct value *retvalp = evaluate_subexp_for_address (exp, pos,
-                                                              noside);
-
-         return retvalp;
-       }
+       return evaluate_subexp_for_address (exp, pos, noside);
 
     case UNOP_SIZEOF:
       if (noside == EVAL_SKIP)
This page took 0.033524 seconds and 4 git commands to generate.