[hackers] [st] Refactor the innermost loop of the xdraws function || Silvan Jegen

From: <git_AT_suckless.org>
Date: Sun, 15 Jun 2014 12:12:27 +0200

commit c2fd2754ebea6f802e4c71219af269c58b78262e
Author: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Fri Jun 6 22:09:22 2014 +0200

    Refactor the innermost loop of the xdraws function
    
    Signed-off-by: Silvan Jegen <s.jegen_AT_gmail.com>
    Signed-off-by: Christoph Lohmann <20h_AT_r-36.net>

diff --git a/st.c b/st.c
index 3681776..2cf9a26 100644
--- a/st.c
+++ b/st.c
_AT_@ -3245,28 +3245,22 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
                         bytelen -= u8cblen;
 
                         doesexist = XftCharExists(xw.dpy, font->match, unicodep);
- if(oneatatime || !doesexist || bytelen <= 0) {
- if(oneatatime || bytelen <= 0) {
- if(doesexist) {
- u8fl++;
- u8fblen += u8cblen;
- }
- }
-
- if(u8fl > 0) {
- XftDrawStringUtf8(xw.draw, fg,
- font->match, xp,
- winy + font->ascent,
- (FcChar8 *)u8fs,
- u8fblen);
- xp += xw.cw * u8fl;
-
- }
- break;
+ if(doesexist) {
+ u8fl++;
+ u8fblen += u8cblen;
+ if(!oneatatime && bytelen > 0)
+ continue;
                         }
 
- u8fl++;
- u8fblen += u8cblen;
+ if(u8fl > 0) {
+ XftDrawStringUtf8(xw.draw, fg,
+ font->match, xp,
+ winy + font->ascent,
+ (FcChar8 *)u8fs,
+ u8fblen);
+ xp += xw.cw * u8fl;
+ }
+ break;
                 }
                 if(doesexist) {
                         if(oneatatime)
Received on Sun Jun 15 2014 - 12:12:27 CEST

This archive was generated by hypermail 2.3.0 : Sun Jun 15 2014 - 12:24:16 CEST