summaryrefslogtreecommitdiffstats
path: root/AffinityPanel.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 /AffinityPanel.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 'AffinityPanel.c')
-rw-r--r--AffinityPanel.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/AffinityPanel.c b/AffinityPanel.c
index e491b524..767e849a 100644
--- a/AffinityPanel.c
+++ b/AffinityPanel.c
@@ -59,25 +59,25 @@ static void MaskItem_delete(Object* cast) {
static void MaskItem_display(const Object* cast, RichString* out) {
const MaskItem* this = (const MaskItem*)cast;
assert (this != NULL);
- RichString_append(out, CRT_colors[CHECK_BOX], "[");
+ RichString_appendAscii(out, CRT_colors[CHECK_BOX], "[");
if (this->value == 2) {
- RichString_append(out, CRT_colors[CHECK_MARK], "x");
+ RichString_appendAscii(out, CRT_colors[CHECK_MARK], "x");
} else if (this->value == 1) {
- RichString_append(out, CRT_colors[CHECK_MARK], "o");
+ RichString_appendAscii(out, CRT_colors[CHECK_MARK], "o");
} else {
- RichString_append(out, CRT_colors[CHECK_MARK], " ");
+ RichString_appendAscii(out, CRT_colors[CHECK_MARK], " ");
}
- RichString_append(out, CRT_colors[CHECK_BOX], "]");
- RichString_append(out, CRT_colors[CHECK_TEXT], " ");
+ RichString_appendAscii(out, CRT_colors[CHECK_BOX], "]");
+ RichString_appendAscii(out, CRT_colors[CHECK_TEXT], " ");
if (this->indent) {
- RichString_append(out, CRT_colors[PROCESS_TREE], this->indent);
- RichString_append(out, CRT_colors[PROCESS_TREE],
- this->sub_tree == 2
- ? CRT_treeStr[TREE_STR_OPEN]
- : CRT_treeStr[TREE_STR_SHUT]);
- RichString_append(out, CRT_colors[CHECK_TEXT], " ");
+ RichString_appendWide(out, CRT_colors[PROCESS_TREE], this->indent);
+ RichString_appendWide(out, CRT_colors[PROCESS_TREE],
+ this->sub_tree == 2
+ ? CRT_treeStr[TREE_STR_OPEN]
+ : CRT_treeStr[TREE_STR_SHUT]);
+ RichString_appendAscii(out, CRT_colors[CHECK_TEXT], " ");
}
- RichString_append(out, CRT_colors[CHECK_TEXT], this->text);
+ RichString_appendWide(out, CRT_colors[CHECK_TEXT], this->text);
}
static const ObjectClass MaskItem_class = {

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