From fa47e4463ab4ee4ddc7858ab11063c7965b232ac Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sun, 19 Jan 2020 11:54:02 -0500 Subject: [PATCH] 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. --- gdb/ChangeLog | 4 ++++ gdb/linux-fork.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index abe7ab7662..f7798def4f 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 284f1985d0..357188685d 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. */