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:
parent
2d0ca82411
commit
60685cd0b9
2 changed files with 6 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue