1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Allocate array buffer beforehand

This commit is contained in:
Takashi Kokubun 2015-11-27 02:09:25 +09:00
parent 2e30013205
commit 0420970001

View file

@ -13,8 +13,8 @@ attr_build_id(VALUE escape_attrs, VALUE ids)
ids = rb_funcall(ids, id_flatten, 0);
truthy_ids = rb_ary_new();
len = RARRAY_LEN(ids);
truthy_ids = rb_ary_new2(len);
for (i = 0; i < len; i++) {
id = rb_ary_entry(ids, i);
if (!NIL_P(id) && id != Qfalse) {