mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: use rb_ary_tmp_new_fill
* parse.y (coverage): use rb_ary_tmp_new_fill() instead of setting internal structure directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e7bcea3831
commit
66c2bbdea3
1 changed files with 1 additions and 5 deletions
6
parse.y
6
parse.y
|
@ -5313,11 +5313,7 @@ coverage(VALUE fname, int n)
|
|||
{
|
||||
VALUE coverages = rb_get_coverages();
|
||||
if (RTEST(coverages) && RBASIC(coverages)->klass == 0) {
|
||||
VALUE lines = rb_ary_new2(n);
|
||||
int i;
|
||||
RBASIC_CLEAR_CLASS(lines);
|
||||
for (i = 0; i < n; i++) RARRAY_ASET(lines, i, Qnil);
|
||||
RARRAY(lines)->as.heap.len = n;
|
||||
VALUE lines = rb_ary_tmp_new_fill(n);
|
||||
rb_hash_aset(coverages, fname, lines);
|
||||
return lines;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue