repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: a7a3219687707a90abb6f8240b30e33b15471a27: path_to: revision_to:
commit a7a3219687707a90abb6f8240b30e33b15471a27 Author: Marc LehmannDate: Thu Jun 17 11:01:57 2021 +0000 a rare codesize + time optimisation diff --git a/src/rxvtfont.h b/src/rxvtfont.h
--- a/src/rxvtfont.h
+++ b/src/rxvtfont.h
@@ -102,6 +102,15 @@ struct rxvt_fontset
return min ((fontCount << 1) | 1, find_font_idx (unicode));
}
+ // find the font containing ' ' - we always assume this is font 1, as
+ // every font should contain space, and font 1 is our base font.
+ // pango assumes this, so it must be correct!
+ int
+ find_space_font ()
+ {
+ return 1 << 1;
+ }
+
private:
rxvt_term *term;
rxvt_fontprop prop;
diff --git a/src/screen.C b/src/screen.C
--- a/src/screen.C
+++ b/src/screen.C
@@ -109,7 +109,7 @@ rxvt_term::scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend
l.touch ();
efs &= ~RS_baseattrMask; // remove italic etc. fontstyles
- efs = SET_FONT (efs, FONTSET (efs)->find_font (' '));
+ efs = SET_FONT (efs, FONTSET (efs)->find_space_font ());
text_t *et = l.t + col;
rend_t *er = l.r + col;
@@ -141,7 +141,7 @@ rxvt_term::scr_kill_char (line_t &l, int col) const noexcept
col--;
rend_t rend = l.r[col] & ~RS_baseattrMask;
- rend = SET_FONT (rend, FONTSET (rend)->find_font (' '));
+ rend = SET_FONT (rend, FONTSET (rend)->find_space_font ());
l.touch ();
-----END OF PAGE-----