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 | 57e2877e7b8257665f07f63aa37ed09f8fe78310 (patch) | |
tree | 1f9d2f407d43672c5a2fa4aaeaa8cfd1255b2f32 /ext/readline/readline.c | |
parent | a015a01354d7f185eb794e3280c4168c2cb38100 (diff) | |
download | ruby-57e2877e7b8257665f07f63aa37ed09f8fe78310.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/readline/readline.c')
-rw-r--r-- | ext/readline/readline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 6aa9177892..c3b98a8dc9 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -963,7 +963,7 @@ readline_attempted_completion_function(const char *text, int start, int end) enc = rb_locale_encoding(); encobj = rb_enc_from_encoding(enc); for (i = 0; i < matches; i++) { - temp = rb_obj_as_string(RARRAY_CONST_PTR(ary)[i]); + temp = rb_obj_as_string(RARRAY_AREF(ary, i)); StringValueCStr(temp); /* must be NUL-terminated */ rb_enc_check(encobj, temp); result[i + 1] = (char*)malloc(RSTRING_LEN(temp) + 1); |