value_maybe_namespace_elt: Remove unnecessary test of result != NULL.
authorDoug Evans <xdje42@gmail.com>
Sat, 13 Dec 2014 07:25:46 +0000 (23:25 -0800)
committerDoug Evans <xdje42@gmail.com>
Sat, 13 Dec 2014 07:25:46 +0000 (23:25 -0800)
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
gdb/valops.c

index f2bdec78920737ef1891101a13ffeef42f5e4563..45e2fb5cf58a572a76927b9519c35b30789c7a8f 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-12  Doug Evans  <xdje42@gmail.com>
+
+       * valops.c (value_maybe_namespace_elt): Remove unnecessary test of
+       result != NULL.
+
 2014-12-12  Doug Evans  <xdje42@gmail.com>
 
        * cp-support.h (cp_is_in_anonymous): Renamed from cp_is_anonymous.
index 4125fc032a22f73cbdf883177573002be17208f7..4d3059eaf6cf5d766fedf33c55e175ef2fd9e4c4 100644 (file)
@@ -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;