diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-07-25 10:40:45 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-07-26 09:12:09 -0400 |
commit | efb91ff19b739b759f40af2673f942e80d212857 (patch) | |
tree | ace9d897856748fba7537390a6674695af23a0f3 /enum.c | |
parent | 3f70aa6504d4c63a3cc928c52d6cf88dafffb40d (diff) |
Rename rb_ary_tmp_new to rb_ary_hidden_new
rb_ary_tmp_new suggests that the array is temporary in some way, but
that's not true, it just creates an array that's hidden and not on the
transient heap. This commit renames it to rb_ary_hidden_new.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6180
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1487,7 +1487,7 @@ enum_sort_by(VALUE obj) ary = rb_ary_new(); } RBASIC_CLEAR_CLASS(ary); - buf = rb_ary_tmp_new(SORT_BY_BUFSIZE*2); + buf = rb_ary_hidden_new(SORT_BY_BUFSIZE*2); rb_ary_store(buf, SORT_BY_BUFSIZE*2-1, Qnil); memo = MEMO_NEW(0, 0, 0); data = (struct sort_by_data *)&memo->v1; @@ -1863,7 +1863,7 @@ rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary) rb_raise(rb_eArgError, "too big size"); data.bufmax = data.n * 4; data.curlen = 0; - data.buf = rb_ary_tmp_new(data.bufmax * (by ? 2 : 1)); + data.buf = rb_ary_hidden_new(data.bufmax * (by ? 2 : 1)); data.limit = Qundef; data.cmpfunc = by ? nmin_cmp : rb_block_given_p() ? nmin_block_cmp : |