Permalink
Browse files

specify know capacity of an array

  • Loading branch information...
1 parent 2830624 commit 0d9b91083b93ec0abd10031dcb5bb892551d5c66 @matz matz committed Oct 4, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 tools/mruby/mruby.c
View
@@ -176,7 +176,7 @@ main(int argc, char **argv)
return n;
}
- ARGV = mrb_ary_new(mrb);
+ ARGV = mrb_ary_new_capa(mrb, args.argc);
for (i = 0; i < args.argc; i++) {
mrb_ary_push(mrb, ARGV, mrb_str_new(mrb, args.argv[i], strlen(args.argv[i])));
}

0 comments on commit 0d9b910

Please sign in to comment.