ruby-changes:65246
From: Nobuyoshi <ko1@a...>
Date: Fri, 12 Feb 2021 13:36:08 +0900 (JST)
Subject: [ruby-changes:65246] e8b210542b (master): Define rb_to_array which converts with to_a
https://git.ruby-lang.org/ruby.git/commit/?id=e8b210542b From e8b210542b7d290d6c3feeff85221ed7303d2aab Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 12 Feb 2021 11:47:04 +0900 Subject: Define rb_to_array which converts with to_a --- array.c | 6 ++++++ internal/array.h | 1 + 2 files changed, 7 insertions(+) diff --git a/array.c b/array.c index 07b3df0..2876548 100644 --- a/array.c +++ b/array.c @@ -996,6 +996,12 @@ rb_check_to_array(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L996 return rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a); } +VALUE +rb_to_array(VALUE ary) +{ + return rb_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a); +} + /* * call-seq: * Array.try_convert(object) -> object, new_array, or nil diff --git a/internal/array.h b/internal/array.h index 44c0efb..00e03c1 100644 --- a/internal/array.h +++ b/internal/array.h @@ -29,6 +29,7 @@ VALUE rb_ary_tmp_new_fill(long capa); https://github.com/ruby/ruby/blob/trunk/internal/array.h#L29 VALUE rb_ary_at(VALUE, VALUE); size_t rb_ary_memsize(VALUE); VALUE rb_to_array_type(VALUE obj); +VALUE rb_to_array(VALUE obj); void rb_ary_cancel_sharing(VALUE ary); static inline VALUE rb_ary_entry_internal(VALUE ary, long offset); -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/