From 26476a0b41c480a5eb2c4ade835f48c70070d146 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 11 Mar 2025 13:46:46 -0400 Subject: Remove unnecessary call to initialize() --- compile.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compile.c b/compile.c index 807a8b91..87ae0edd 100644 --- a/compile.c +++ b/compile.c @@ -4027,7 +4027,7 @@ CORD compile_cli_arg_call(env_t *env, CORD fn_name, type_t *fn_type) CORD compile_function(env_t *env, CORD name_code, ast_t *ast, CORD *staticdefs) { - bool is_private = false, is_main = false; + bool is_private = false; const char *function_name; arg_ast_t *args; type_t *ret_t; @@ -4038,7 +4038,6 @@ CORD compile_function(env_t *env, CORD name_code, ast_t *ast, CORD *staticdefs) auto fndef = Match(ast, FunctionDef); function_name = Match(fndef->name, Var)->name; is_private = function_name[0] == '_'; - is_main = streq(function_name, "main"); args = fndef->args; ret_t = fndef->ret_type ? parse_type_ast(env, fndef->ret_type) : Type(VoidType); body = fndef->body; @@ -4114,8 +4113,6 @@ CORD compile_function(env_t *env, CORD name_code, ast_t *ast, CORD *staticdefs) } CORD body_code = compile_statement(body_scope, body); - if (is_main) - body_code = CORD_all("_$", env->namespace->name, "$$initialize();\n", body_code); if (CORD_fetch(body_code, 0) != '{') body_code = CORD_asprintf("{\n%r\n}", body_code); -- cgit v1.2.3