diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-05 01:09:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-05 01:09:17 +0000 |
commit | b2b8a5b41667a2612e8cd20a340dad7c2ea14737 (patch) | |
tree | 1f9d2f407d43672c5a2fa4aaeaa8cfd1255b2f32 /ext/socket/socket.c | |
parent | 60a5717c89786738b297c95e36acaa245879f1de (diff) | |
download | ruby-b2b8a5b41667a2612e8cd20a340dad7c2ea14737.tar.gz |
ext: use RARRAY_AREF
* ext/**/*.c: prefer RARRAY_AREF to indexing RARRAY_CONST_PTR.
pointed out by hanmac.
https://github.com/ruby/ruby/commit/3553a86#commitcomment-14187670
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r-- | ext/socket/socket.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 30bc625c9f..8a3541ac30 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -1406,16 +1406,16 @@ sock_s_getnameinfo(int argc, VALUE *argv) sa = tmp; MEMZERO(&hints, struct addrinfo, 1); if (RARRAY_LEN(sa) == 3) { - af = RARRAY_CONST_PTR(sa)[0]; - port = RARRAY_CONST_PTR(sa)[1]; - host = RARRAY_CONST_PTR(sa)[2]; + af = RARRAY_AREF(sa, 0); + port = RARRAY_AREF(sa, 1); + host = RARRAY_AREF(sa, 2); } else if (RARRAY_LEN(sa) >= 4) { - af = RARRAY_CONST_PTR(sa)[0]; - port = RARRAY_CONST_PTR(sa)[1]; - host = RARRAY_CONST_PTR(sa)[3]; + af = RARRAY_AREF(sa, 0); + port = RARRAY_AREF(sa, 1); + host = RARRAY_AREF(sa, 3); if (NIL_P(host)) { - host = RARRAY_CONST_PTR(sa)[2]; + host = RARRAY_AREF(sa, 2); } else { /* |