diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-02-12 12:21:49 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-02-12 12:21:49 +0900 |
commit | 1f0e0dfb228fd14b3f6687539ba274ba6a2d1643 (patch) | |
tree | 0d06f1dcea4a1d63004bf51f07408034dbf58f5e /thread_sync.c | |
parent | e8b210542b7d290d6c3feeff85221ed7303d2aab (diff) | |
download | ruby-1f0e0dfb228fd14b3f6687539ba274ba6a2d1643.tar.gz |
Thread::Queue.new should accept an Enumerable [Feature #17327]
Enumerable implements #to_a but not #to_array.
Diffstat (limited to 'thread_sync.c')
-rw-r--r-- | thread_sync.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/thread_sync.c b/thread_sync.c index 131ace2fda..94e6340b16 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -858,7 +858,7 @@ rb_queue_initialize(int argc, VALUE *argv, VALUE self) list_head_init(queue_waitq(q)); rb_scan_args(argc, argv, "01", &initial); if (argc == 1) { - rb_ary_concat(q->que, rb_convert_type(initial, T_ARRAY, "Array", "to_ary")); + rb_ary_concat(q->que, rb_to_array(initial)); } return self; } |