From: Simon Marchi Date: Sun, 19 Jan 2020 16:54:02 +0000 (-0500) Subject: gdb/linux-fork: simplify one_fork_p X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fa47e4463ab4ee4ddc7858ab11063c7965b232ac;p=binutils-gdb.git gdb/linux-fork: simplify one_fork_p Unless I'm missing something, this function is a complicated way of saying "fork_list.size () == 1". gdb/ChangeLog: * linux-fork.c (one_fork_p): Simplify. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index abe7ab76621..f7798def4fb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2020-01-19 Simon Marchi + + * linux-fork.c (one_fork_p): Simplify. + 2020-01-17 Simon Marchi * top.c (struct qt_args): Remove. diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index 284f1985d0d..357188685d0 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -110,8 +110,7 @@ find_last_fork (void) static bool one_fork_p () { - return (!fork_list.empty () - && &fork_list.front () == &fork_list.back ()); + return fork_list.size () == 1; } /* Add a new fork to the internal fork list. */