aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-01-19 11:54:02 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2020-01-19 11:54:02 -0500
commitfa47e4463ab4ee4ddc7858ab11063c7965b232ac (patch)
tree0061c03a67b96b08855a7b46c42037c9cb32f5bf /gdb
parent6ae3a726d4c5cfa01630663536d0d2cae94b0542 (diff)
downloadgdb-fa47e4463ab4ee4ddc7858ab11063c7965b232ac.zip
gdb-fa47e4463ab4ee4ddc7858ab11063c7965b232ac.tar.gz
gdb-fa47e4463ab4ee4ddc7858ab11063c7965b232ac.tar.bz2
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/linux-fork.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index abe7ab7..f7798de 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2020-01-19 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * linux-fork.c (one_fork_p): Simplify.
+
2020-01-17 Simon Marchi <simon.marchi@efficios.com>
* top.c (struct qt_args): Remove.
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 284f198..3571886 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. */