From 0f284091d161dbca6e07de85896cbdc9abd2de6b Mon Sep 17 00:00:00 2001 From: cremno Date: Thu, 16 Jul 2015 04:58:21 +0200 Subject: delete mrb_free()-related non-NULL checks No need to optimize since a program only exits once and errors are rare. Also the mruby source code doesn't have these kind of checks elsewhere. The ones in {Time,Random}#initialize are kept because there it actually matters since initialization always happens and re-initialization is unlikely. --- mrbgems/mruby-bin-mruby/tools/mruby/mruby.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mrbgems/mruby-bin-mruby') diff --git a/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c b/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c index 141ea151b..5ca744388 100644 --- a/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +++ b/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c @@ -159,10 +159,9 @@ cleanup(mrb_state *mrb, struct _args *args) { if (args->rfp && args->rfp != stdin) fclose(args->rfp); - if (args->cmdline && !args->fname) + if (!args->fname) mrb_free(mrb, args->cmdline); - if (args->argv) - mrb_free(mrb, args->argv); + mrb_free(mrb, args->argv); mrb_close(mrb); } -- cgit v1.2.3