mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
gdbserver/linux: take condition out of callback in find_lwp_pid
Just a small optimization, it's not necessary to recompute lwp at each iteration. While at it, change the variable type to long, as ptid_t::lwp returns a long. Reviewed-By: Andrew Burgess <aburgess@redhat.com> Change-Id: I181670ce1f90b59cb09ea4899367750be2ad9105
This commit is contained in:
@@ -1731,9 +1731,9 @@ linux_process_target::status_pending_p_callback (thread_info *thread,
|
||||
struct lwp_info *
|
||||
find_lwp_pid (ptid_t ptid)
|
||||
{
|
||||
thread_info *thread = find_thread ([&] (thread_info *thr_arg)
|
||||
long lwp = ptid.lwp () != 0 ? ptid.lwp () : ptid.pid ();
|
||||
thread_info *thread = find_thread ([lwp] (thread_info *thr_arg)
|
||||
{
|
||||
int lwp = ptid.lwp () != 0 ? ptid.lwp () : ptid.pid ();
|
||||
return thr_arg->id.lwp () == lwp;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user