summaryrefslogtreecommitdiffstats
path: root/Meter.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-12-04 14:44:57 +0100
committerBenBE <BenBE@geshi.org>2020-12-08 20:58:40 +0100
commit157086e750187f6bceeea697d10bf58403c7d5de (patch)
tree82c6512c1a1e88c9ab9f77ca9bf1531da265e331 /Meter.c
parent5506925b346b09f8556ce2c8f83fe3d69dc1c03c (diff)
Split RichString_(append|appendn|write) into wide and ascii
RichString_writeFrom takes a top spot during performance analysis due to the calls to mbstowcs() and iswprint(). Most of the time we know in advance that we are only going to print regular ASCII characters.
Diffstat (limited to 'Meter.c')
-rw-r--r--Meter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Meter.c b/Meter.c
index 945911c9..b006a584 100644
--- a/Meter.c
+++ b/Meter.c
@@ -100,7 +100,7 @@ static inline void Meter_displayBuffer(const Meter* this, const char* buffer, Ri
if (Object_displayFn(this)) {
Object_display(this, out);
} else {
- RichString_write(out, CRT_colors[Meter_attributes(this)[0]], buffer);
+ RichString_writeWide(out, CRT_colors[Meter_attributes(this)[0]], buffer);
}
}
@@ -201,7 +201,7 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
RichString_begin(bar);
RichString_appendChr(&bar, ' ', padding);
- RichString_append(&bar, 0, buffer);
+ RichString_appendWide(&bar, 0, buffer);
assert(RichString_sizeVal(bar) >= w);
int blockSizes[10];

© 2014-2024 Faster IT GmbH | imprint | privacy policy