mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Let the backtrace array constructed in backtrace_collect be initialized with the size already given
This commit is contained in:
parent
0095362918
commit
fecaa6e946
Notes:
git
2019-10-29 11:32:31 +09:00
1 changed files with 1 additions and 1 deletions
|
@ -578,7 +578,7 @@ backtrace_collect(rb_backtrace_t *bt, long lev, long n, VALUE (*func)(rb_backtra
|
|||
rb_bug("backtrace_collect: unreachable");
|
||||
}
|
||||
|
||||
btary = rb_ary_new();
|
||||
btary = rb_ary_new2(n);
|
||||
|
||||
for (i=0; i+lev<bt->backtrace_size && i<n; i++) {
|
||||
rb_backtrace_location_t *loc = &bt->backtrace[bt->backtrace_size - 1 - (lev+i)];
|
||||
|
|
Loading…
Reference in a new issue