summaryrefslogtreecommitdiff
path: root/gdb/python/py-inferior.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2017-01-23 15:31:40 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2017-01-23 15:31:40 -0500
commit60685cd0b99c575a32c3d004b4af568dd0309bcb (patch)
tree8907aebf3841495e8fcb6bf276ab4fe1ee9212c6 /gdb/python/py-inferior.c
parent2d0ca824112f269a883cd04d344614ccab3baaf4 (diff)
Minor simplification of (Python) find_thread_object
Since the reference to the Inferior Python object is managed by gdbpy_ref (RAII), we can return directly from the loop. It's just a leftover from the cleanups era. gdb/ChangeLog: * python/py-inferior.c (find_thread_object): Return directly from the loop. Remove "found" variable.
Diffstat (limited to 'gdb/python/py-inferior.c')
-rw-r--r--gdb/python/py-inferior.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index 9e10d62c51..b2aaf25e8a 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -251,7 +251,6 @@ find_thread_object (ptid_t ptid)
{
int pid;
struct threadlist_entry *thread;
- thread_object *found = NULL;
pid = ptid_get_pid (ptid);
if (pid == 0)
@@ -264,13 +263,7 @@ find_thread_object (ptid_t ptid)
for (thread = ((inferior_object *)(inf_obj.get ()))->threads; thread;
thread = thread->next)
if (ptid_equal (thread->thread_obj->thread->ptid, ptid))
- {
- found = thread->thread_obj;
- break;
- }
-
- if (found)
- return found;
+ return thread->thread_obj;
return NULL;
}