dumping ground for random patches and texts
 help / color / mirror / Atom feed
* [PATCH] ext/socket/raddrinfo.c (addrinfo_mark): avoid needless branch
@ 2017-03-09  3:47 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2017-03-09  3:47 UTC (permalink / raw)
  To: spew

gc.c (gc_mark_children, case T_DATA) does not use
the dmark function pointer if DATA_PTR is NULL
---
 ext/socket/raddrinfo.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index 67bc9c2a97..dcabb2022e 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -726,10 +726,8 @@ static void
 addrinfo_mark(void *ptr)
 {
     rb_addrinfo_t *rai = ptr;
-    if (rai) {
-        rb_gc_mark(rai->inspectname);
-        rb_gc_mark(rai->canonname);
-    }
+    rb_gc_mark(rai->inspectname);
+    rb_gc_mark(rai->canonname);
 }
 
 #define addrinfo_free RUBY_TYPED_DEFAULT_FREE
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-09  3:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-09  3:47 [PATCH] ext/socket/raddrinfo.c (addrinfo_mark): avoid needless branch Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).