diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 15:00:28 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 15:00:28 -0400 |
| commit | 82849ba783e2b8f8e3a040751cd964313470e7f2 (patch) | |
| tree | 89380c5026b4da43d88658a5acf4d2c656ead8fe /builtins/table.c | |
| parent | 29a87ff325b5d9682593d66bd17964e5c2447510 (diff) | |
Use Text("...") literal constructor instead of Text$from_str("...")
function call.
Diffstat (limited to 'builtins/table.c')
| -rw-r--r-- | builtins/table.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/builtins/table.c b/builtins/table.c index 9bc3ded1..22797775 100644 --- a/builtins/table.c +++ b/builtins/table.c @@ -459,34 +459,34 @@ public Text_t Table$as_text(const table_t *t, bool colorize, const TypeInfo *typ if (!t) { if (table.value != &$Void) return Text$concat( - Text$from_str("{"), + Text("{"), generic_as_text(NULL, false, table.key), - Text$from_str(":"), + Text(":"), generic_as_text(NULL, false, table.value), - Text$from_str("}")); + Text("}")); else return Text$concat( - Text$from_str("{"), + Text("{"), generic_as_text(NULL, false, table.key), - Text$from_str("}")); + Text("}")); } int64_t val_off = value_offset(type); - Text_t text = Text$from_str("{"); + Text_t text = Text("{"); for (int64_t i = 0, length = Table$length(*t); i < length; i++) { if (i > 0) - text = Text$concat(text, Text$from_str(", ")); + text = Text$concat(text, Text(", ")); void *entry = GET_ENTRY(*t, i); text = Text$concat(text, generic_as_text(entry, colorize, table.key)); if (table.value != &$Void) - text = Text$concat(text, Text$from_str(":"), generic_as_text(entry + val_off, colorize, table.value)); + text = Text$concat(text, Text(":"), generic_as_text(entry + val_off, colorize, table.value)); } if (t->fallback) { - text = Text$concat(text, Text$from_str("; fallback="), Table$as_text(t->fallback, colorize, type)); + text = Text$concat(text, Text("; fallback="), Table$as_text(t->fallback, colorize, type)); } - text = Text$concat(text, Text$from_str("}")); + text = Text$concat(text, Text("}")); return text; } |
