Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb/linux-fork: simplify one_fork_p
@ 2020-01-19 16:18 Simon Marchi
  2020-01-19 16:53 ` Christian Biesinger via gdb-patches
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2020-01-19 16:18 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

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/linux-fork.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 284f1985d0dc..357188685d07 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.  */
-- 
2.24.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-20 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-19 16:18 [PATCH] gdb/linux-fork: simplify one_fork_p Simon Marchi
2020-01-19 16:53 ` Christian Biesinger via gdb-patches
2020-01-19 16:57   ` Simon Marchi
2020-01-19 17:01     ` Christian Biesinger via gdb-patches
2020-01-20 15:13       ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox