diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-01-23 15:33:56 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-01-23 15:33:56 -0500 |
| commit | f93dde14496ef784df6b7b3e1de1030a868be985 (patch) | |
| tree | e4f5bcc1852d13e2f2d853a1f6590ccdd93e18a2 /stdlib/stdlib.c | |
| parent | c60ea2079fb230213308904cd0966e5481d2d994 (diff) | |
Overhaul of Text implementation to be more like Cords and have much
better performance for long sequences of repeated concatenation.
Diffstat (limited to 'stdlib/stdlib.c')
| -rw-r--r-- | stdlib/stdlib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stdlib/stdlib.c b/stdlib/stdlib.c index cb9d2213..bab97900 100644 --- a/stdlib/stdlib.c +++ b/stdlib/stdlib.c @@ -500,12 +500,12 @@ public void end_test(const void *expr, const TypeInfo_t *type, const char *expec if (expected && expected[0]) { Text_t expected_text = Text$from_str(expected); Text_t expr_plain = USE_COLOR ? generic_as_text(expr, false, type) : expr_text; - bool success = Text$equal(&expr_plain, &expected_text, &Text$info); + bool success = Text$equal_values(expr_plain, expected_text); if (!success) { OptionalMatch_t colon = Text$find(expected_text, Text(":"), I_small(1)); if (colon.index.small) { Text_t with_type = Text$concat(expr_plain, Text(" : "), type_name); - success = Text$equal(&with_type, &expected_text, &Text$info); + success = Text$equal_values(with_type, expected_text); } } @@ -594,7 +594,7 @@ public bool pop_flag(char **argv, int *i, const char *flag, Text_t *result) if (argv[*i][0] != '-' || argv[*i][1] != '-') { return false; } else if (streq(argv[*i] + 2, flag)) { - *result = (Text_t){.length=0}; + *result = EMPTY_TEXT; argv[*i] = NULL; *i += 1; return true; |
