mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-28 14:08:09 +08:00
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.
This commit is contained in:

committed by
Simon Marchi

parent
2d0ca82411
commit
60685cd0b9
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user