diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-12-23 13:58:33 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-12-23 14:00:42 -0500 |
| commit | 4a6c0438f9a2c82e834116e3e1bc110b8cae8432 (patch) | |
| tree | 3cae849d6f4688a68f7417f103a6a2feaf421b06 /src/stdlib/numX.c.h | |
| parent | a89500afd9a34f2af94ab6fcd7a0469b0450732a (diff) | |
Big speedup my trimming down MAP_LIST macro and inlining some
applications of it.
Diffstat (limited to 'src/stdlib/numX.c.h')
| -rw-r--r-- | src/stdlib/numX.c.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stdlib/numX.c.h b/src/stdlib/numX.c.h index 0e84708f..2fde8c45 100644 --- a/src/stdlib/numX.c.h +++ b/src/stdlib/numX.c.h @@ -50,7 +50,7 @@ PUREFUNC Text_t NAMESPACED(as_text)(const void *x, bool colorize, const TypeInfo if (!x) return Text(TYPE_STR); static const Text_t color_prefix = Text("\x1b[35m"), color_suffix = Text("\x1b[m"); Text_t text = NAMESPACED(value_as_text)(*(NUM_T *)x); - return colorize ? Texts(color_prefix, text, color_suffix) : text; + return colorize ? Text$concat(color_prefix, text, color_suffix) : text; } public PUREFUNC int32_t NAMESPACED(compare)(const void *x, const void *y, const TypeInfo_t *info) { @@ -73,7 +73,7 @@ PUREFUNC Text_t NAMESPACED(as_text)(const void *x, bool colorize, const TypeInfo if (!x) return Text(TYPE_STR); static const Text_t color_prefix = Text("\x1b[35m"), color_suffix = Text("\x1b[m"); Text_t text = Num$value_as_text((double)*(NUM_T *)x); - return colorize ? Texts(color_prefix, text, color_suffix) : text; + return colorize ? Text$concat(color_prefix, text, color_suffix) : text; } public PUREFUNC int32_t NAMESPACED(compare)(const void *x, const void *y, const TypeInfo_t *info) { @@ -115,7 +115,7 @@ public Text_t NAMESPACED(percent)(NUM_T x, NUM_T precision) { NUM_T d = SUFFIXED(100.) * x; d = NAMESPACED(with_precision)(d, precision); - return Texts(NAMESPACED(value_as_text)(d), Text("%")); + return Text$concat(NAMESPACED(value_as_text)(d), Text("%")); } public |
