From 98592bbb1dbdb867994dcf463bdd36f98878fffc Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Mon, 6 Feb 2006 21:52:15 +0000 Subject: [PATCH] Hoist FcFileIsDir check out of FcFileScanConfig loop. reviewed by: plam --- ChangeLog | 6 ++++++ src/fcdir.c | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89d4355..0b0fe85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-02-06 Takashi Iwai + reviewed by: plam + * src/fcdir.c (FcFileScanConfig): + + Hoist FcFileIsDir check out of FcFileScanConfig loop. + 2006-02-06 Takashi Iwai reviewed by: plam diff --git a/src/fcdir.c b/src/fcdir.c index d75f8a3..0e559e5 100644 --- a/src/fcdir.c +++ b/src/fcdir.c @@ -47,14 +47,17 @@ FcFileScanConfig (FcFontSet *set, int id; FcPattern *font; FcBool ret = FcTrue; - FcBool isDir; int count = 0; if (config && !FcConfigAcceptFilename (config, file)) return FcTrue; + if (FcFileIsDir (file)) + return FcStrSetAdd (dirs, file); + if (force) cache = 0; + id = 0; do { @@ -70,12 +73,6 @@ FcFileScanConfig (FcFontSet *set, font = FcFreeTypeQuery (file, id, blanks, &count); if (FcDebug () & FC_DBG_SCAN) printf ("done\n"); - isDir = FcFalse; - if (!font && FcFileIsDir (file)) - { - isDir = FcTrue; - ret = FcStrSetAdd (dirs, file); - } /* * Add the font */ -- 2.39.5