summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-27 09:27:47 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-27 09:27:47 (GMT)
commitd0fa578cdcb041ec3e42d8bcba0bfcf9984def6d (patch)
treea59362bd849e66a7b5556245b8a42fd2c6cfb110 /vm_insnhelper.c
parent9473f86fb0ca396adaccf151874604faf47d852e (diff)
array.c: rb_check_to_array
* array.c (rb_check_to_array): conversion to array by to_a method. returns nil if not possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 0fbf39d2..1ba3cce 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2968,8 +2968,8 @@ static VALUE
vm_concat_array(VALUE ary1, VALUE ary2st)
{
const VALUE ary2 = ary2st;
- VALUE tmp1 = rb_check_convert_type_with_id(ary1, T_ARRAY, "Array", idTo_a);
- VALUE tmp2 = rb_check_convert_type_with_id(ary2, T_ARRAY, "Array", idTo_a);
+ VALUE tmp1 = rb_check_to_array(ary1);
+ VALUE tmp2 = rb_check_to_array(ary2);
if (NIL_P(tmp1)) {
tmp1 = rb_ary_new3(1, ary1);
@@ -2988,7 +2988,7 @@ vm_concat_array(VALUE ary1, VALUE ary2st)
static VALUE
vm_splat_array(VALUE flag, VALUE ary)
{
- VALUE tmp = rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a);
+ VALUE tmp = rb_check_to_array(ary);
if (NIL_P(tmp)) {
return rb_ary_new3(1, ary);
}