summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-09 03:49:47 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-09 03:49:47 +0000
commitf1de2e0070e838a6c9782661b230e0cd0a7ccf15 (patch)
treed5f6bce4ce463646e6aa26e67fd21acca98e2750 /ext/socket
parenta3c23f0074eaece71bac838af0e32e366ae0d760 (diff)
ext/socket/raddrinfo.c (addrinfo_mark): avoid needless branch
gc.c (gc_mark_children, case T_DATA) does not use the dmark function pointer if DATA_PTR is NULL git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/raddrinfo.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index 67bc9c2..dcabb20 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