From ae6a105d22fb603dbfb956bbcedf9ae469323d55 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Fri, 12 Dec 2014 23:25:46 -0800 Subject: [PATCH] value_maybe_namespace_elt: Remove unnecessary test of result != NULL. Both allocate_value and value_of_variable are guaranteed to return non-NULL. gdb/ChangeLog: * valops.c (value_maybe_namespace_elt): Remove unnecessary test of result != NULL. --- gdb/ChangeLog | 5 +++++ gdb/valops.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f2bdec78920..45e2fb5cf58 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-12-12 Doug Evans + + * valops.c (value_maybe_namespace_elt): Remove unnecessary test of + result != NULL. + 2014-12-12 Doug Evans * cp-support.h (cp_is_in_anonymous): Renamed from cp_is_anonymous. diff --git a/gdb/valops.c b/gdb/valops.c index 4125fc032a2..4d3059eaf6c 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -3586,7 +3586,7 @@ value_maybe_namespace_elt (const struct type *curtype, else result = value_of_variable (sym, get_selected_block (0)); - if (result && want_address) + if (want_address) result = value_addr (result); return result; -- 2.30.2