Skip to content

Commit 52fb7d2

Browse files
committed
ssl: remove unnecessary constant lookup
rb_eSystemCallError is defined in Ruby's public header files, so let's just use it. Also, clean up the arguments to the rb_rescue2() call.
1 parent 87a9e19 commit 52fb7d2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ext/openssl/ossl_ssl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,10 +1550,8 @@ fallback_peer_ip_address(VALUE self, VALUE args)
15501550
static VALUE
15511551
peeraddr_ip_str(VALUE self)
15521552
{
1553-
VALUE rb_mErrno = rb_const_get(rb_cObject, rb_intern("Errno"));
1554-
VALUE rb_eSystemCallError = rb_const_get(rb_mErrno, rb_intern("SystemCallError"));
1555-
1556-
return rb_rescue2(peer_ip_address, self, fallback_peer_ip_address, (VALUE)0, rb_eSystemCallError, NULL);
1553+
return rb_rescue2(peer_ip_address, self, fallback_peer_ip_address, Qnil,
1554+
rb_eSystemCallError, (VALUE)0);
15571555
}
15581556

15591557
/*

0 commit comments

Comments
 (0)