[03/10] gdb/python: remove unneeded nullptr check in frapy_block

Message ID ab3e64662c1b6ebaae7da776f1f4a3e1656b72c8.1678460067.git.aburgess@redhat.com
State New
Headers
Series Improvements & Cleanup For Python Unwinder API |

Commit Message

Andrew Burgess March 10, 2023, 2:55 p.m. UTC
  Spotted a redundant nullptr check in python/py-frame.c in the function
frapy_block.  This was introduced in commit 57126e4a45e3000e when we
expanded an earlier check in return early if the pointer in question
is nullptr.

There should be no user visible changes after this commit.
---
 gdb/python/py-frame.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
  

Patch

diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index ecd55d2e568..00cd4bee492 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -304,13 +304,7 @@  frapy_block (PyObject *self, PyObject *args)
       return NULL;
     }
 
-  if (block)
-    {
-      return block_to_block_object
-	(block, fn_block->function ()->objfile ());
-    }
-
-  Py_RETURN_NONE;
+  return block_to_block_object (block, fn_block->function ()->objfile ());
 }