aboutsummaryrefslogtreecommitdiff
path: root/src/compile/promotions.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-23 13:58:33 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-23 14:00:42 -0500
commit4a6c0438f9a2c82e834116e3e1bc110b8cae8432 (patch)
tree3cae849d6f4688a68f7417f103a6a2feaf421b06 /src/compile/promotions.c
parenta89500afd9a34f2af94ab6fcd7a0469b0450732a (diff)
Big speedup my trimming down MAP_LIST macro and inlining some
applications of it.
Diffstat (limited to 'src/compile/promotions.c')
-rw-r--r--src/compile/promotions.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compile/promotions.c b/src/compile/promotions.c
index 5b0ccb95..482e5ed0 100644
--- a/src/compile/promotions.c
+++ b/src/compile/promotions.c
@@ -61,12 +61,12 @@ bool promote(env_t *env, ast_t *ast, Text_t *code, type_t *actual, type_t *neede
// Automatic optional checking for nums:
if (needed->tag == NumType && actual->tag == OptionalType && Match(actual, OptionalType)->type->tag == NumType) {
int64_t line = get_line_number(ast->file, ast->start);
- *code =
- Texts("({ ", compile_declaration(actual, Text("opt")), " = ", *code, "; ", "if unlikely (",
- check_none(actual, Text("opt")), ")\n", "#line ", line, "\n", "fail_source(",
- quoted_str(ast->file->filename), ", ", (int64_t)(ast->start - ast->file->text), ", ",
- (int64_t)(ast->end - ast->file->text), ", ", "\"This was expected to be a value, but it's none\");\n",
- optional_into_nonnone(actual, Text("opt")), "; })");
+ *code = Texts("({ ", compile_declaration(actual, Text("opt")), " = ", *code, "; ", "if unlikely (",
+ check_none(actual, Text("opt")), ")\n", "#line ", line, "\n", "fail_source(",
+ quoted_str(ast->file->filename), ", ", (int64_t)(ast->start - ast->file->text), ", ",
+ (int64_t)(ast->end - ast->file->text), ", ",
+ "Text(\"This was expected to be a value, but it's none\"));\n",
+ optional_into_nonnone(actual, Text("opt")), "; })");
return true;
}