]> git.wh0rd.org Git - fontconfig.git/commitdiff
Hoist FcFileIsDir check out of FcFileScanConfig loop.
authorPatrick Lam <plam@MIT.EDU>
Mon, 6 Feb 2006 21:52:15 +0000 (21:52 +0000)
committerPatrick Lam <plam@MIT.EDU>
Mon, 6 Feb 2006 21:52:15 +0000 (21:52 +0000)
reviewed by: plam

ChangeLog
src/fcdir.c

index 89d43550767ffdaab0077b8a3c54799d6f35c208..0b0fe85648f43c1b797d65ddbac86dab7816522a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-06  Takashi Iwai  <tiwai@suse.de>
+       reviewed by: plam
+       * src/fcdir.c (FcFileScanConfig):
+
+       Hoist FcFileIsDir check out of FcFileScanConfig loop.
+
 2006-02-06  Takashi Iwai  <tiwai@suse.de>
        reviewed by: plam
 
index d75f8a34dd7fd7dfb5d577582f06af4dd3e480d7..0e559e5f0b3683f47d02712b47acf0ff80e9aad9 100644 (file)
@@ -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
         */