[hackers] [st] Simplify xunloadfonts. || noname

From: <git_AT_suckless.org>
Date: Tue, 29 Apr 2014 10:00:49 +0200

commit 0e439e5624113233525266c2a104792f2c33b7e3
Author: noname <noname_AT_inventati.org>
Date: Mon Apr 28 02:41:17 2014 +0400

    Simplify xunloadfonts.

diff --git a/st.c b/st.c
index 9079834..672c47a 100644
--- a/st.c
+++ b/st.c
_AT_@ -2993,13 +2993,9 @@ xunloadfont(Font *f) {
 
 void
 xunloadfonts(void) {
- int i;
-
         /* Free the loaded fonts in the font cache. */
- for(i = 0; i < frclen; i++) {
- XftFontClose(xw.dpy, frc[i].font);
- }
- frclen = 0;
+ while(frclen > 0)
+ XftFontClose(xw.dpy, frc[--frclen].font);
 
         xunloadfont(&dc.font);
         xunloadfont(&dc.bfont);
Received on Tue Apr 29 2014 - 10:00:49 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 29 2014 - 10:12:07 CEST