aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2020-05-09 14:03:14 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2020-05-09 14:11:25 +0200
commitcde480c6939e62771ba3b60ef4eb848031aee9f9 (patch)
treec6fa193ace7dff9b5d44cc696b8a90ba67ef68aa
parent8211e36d281990a39db1853bcd454ac59e53d521 (diff)
downloadst-patched-cde480c6939e62771ba3b60ef4eb848031aee9f9.tar.bz2
st-patched-cde480c6939e62771ba3b60ef4eb848031aee9f9.tar.xz
st-patched-cde480c6939e62771ba3b60ef4eb848031aee9f9.zip
optimize column width calculation and utf-8 encode for ASCII
In particular on OpenBSD and on glibc wcwidth() is quite expensive. On musl there is little difference.
-rw-r--r--st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/st.c b/st.c
index 5d4054f..1414f98 100644
--- a/st.c
+++ b/st.c
@@ -2307,7 +2307,7 @@ tputc(Rune u)
2307 Glyph *gp; 2307 Glyph *gp;
2308 2308
2309 control = ISCONTROL(u); 2309 control = ISCONTROL(u);
2310 if (!IS_SET(MODE_UTF8 | MODE_SIXEL)) { 2310 if (u < 127 || !IS_SET(MODE_UTF8 | MODE_SIXEL)) {
2311 c[0] = u; 2311 c[0] = u;
2312 width = len = 1; 2312 width = len = 1;
2313 } else { 2313 } else {