mruby-pack/pack.c (mrb_pack_pack): use direct array buffer access

We don't need index wrap-around not boundary check here, so we can use
faster direct array access.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-06-29 22:54:58 +09:00
parent 0c4f5a4093
commit ea649e70b8
+1 -1
View File
@@ -1421,7 +1421,7 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary)
if (count == 0 && !(flags & PACK_FLAG_WIDTH))
break;
o = mrb_ary_ref(mrb, ary, aidx);
o = RARRAY_PTR(ary)[aidx];
if (type == PACK_TYPE_INTEGER) {
o = mrb_ensure_int_type(mrb, o);
}