From 9ca092d59e9e393403890b825c6bc953ad51f5ad Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Fri, 27 Nov 2015 01:25:31 +0900 Subject: [PATCH] I'm not sure this is necessary --- ext/hamlit/hamlit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/hamlit/hamlit.c b/ext/hamlit/hamlit.c index bff7d3c0..985e95f0 100644 --- a/ext/hamlit/hamlit.c +++ b/ext/hamlit/hamlit.c @@ -7,12 +7,13 @@ static VALUE attr_build_id(VALUE escape_attrs, VALUE ids) { VALUE truthy_ids, id, attr_value, mUtils; - int i; + int i, len; ids = rb_funcall(ids, id_flatten, 0); truthy_ids = rb_ary_new(); - for (i = 0; i < RARRAY_LEN(ids); i++) { + len = RARRAY_LEN(ids); + for (i = 0; i < len; i++) { id = rb_ary_entry(ids, i); if (!NIL_P(id) && id != Qfalse) { rb_ary_push(truthy_ids, id);