summaryrefslogtreecommitdiffstats
path: root/LoadAverageMeter.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 /LoadAverageMeter.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 'LoadAverageMeter.c')
-rw-r--r--LoadAverageMeter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/LoadAverageMeter.c b/LoadAverageMeter.c
index d5424cd2..248d65cd 100644
--- a/LoadAverageMeter.c
+++ b/LoadAverageMeter.c
@@ -33,11 +33,11 @@ static void LoadAverageMeter_display(const Object* cast, RichString* out) {
const Meter* this = (const Meter*)cast;
char buffer[20];
xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[0]);
- RichString_write(out, CRT_colors[LOAD_AVERAGE_ONE], buffer);
+ RichString_writeAscii(out, CRT_colors[LOAD_AVERAGE_ONE], buffer);
xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[1]);
- RichString_append(out, CRT_colors[LOAD_AVERAGE_FIVE], buffer);
+ RichString_appendAscii(out, CRT_colors[LOAD_AVERAGE_FIVE], buffer);
xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[2]);
- RichString_append(out, CRT_colors[LOAD_AVERAGE_FIFTEEN], buffer);
+ RichString_appendAscii(out, CRT_colors[LOAD_AVERAGE_FIFTEEN], buffer);
}
static void LoadMeter_updateValues(Meter* this, char* buffer, size_t size) {
@@ -53,7 +53,7 @@ static void LoadMeter_display(const Object* cast, RichString* out) {
const Meter* this = (const Meter*)cast;
char buffer[20];
xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[0]);
- RichString_write(out, CRT_colors[LOAD], buffer);
+ RichString_writeAscii(out, CRT_colors[LOAD], buffer);
}
const MeterClass LoadAverageMeter_class = {

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