summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-05 01:09:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-05 01:09:17 +0000
commit57e2877e7b8257665f07f63aa37ed09f8fe78310 (patch)
tree1f9d2f407d43672c5a2fa4aaeaa8cfd1255b2f32 /ext/socket/socket.c
parenta015a01354d7f185eb794e3280c4168c2cb38100 (diff)
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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 30bc625..8a3541a 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 {
/*