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.
+2017-01-23 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * python/py-inferior.c (find_thread_object): Return directly
+ from the loop. Remove "found" variable.
+
2017-01-21 Joel Brobecker <brobecker@adacore.com>
GDB 7.12.1 released.
{
int pid;
struct threadlist_entry *thread;
- thread_object *found = NULL;
pid = ptid_get_pid (ptid);
if (pid == 0)
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;
}