]> git.wh0rd.org - fontconfig.git/commitdiff
Make the perf guys hate me a bit less: hoist the directory-name
authorPatrick Lam <plam@MIT.EDU>
Tue, 29 Nov 2005 06:23:00 +0000 (06:23 +0000)
committerPatrick Lam <plam@MIT.EDU>
Tue, 29 Nov 2005 06:23:00 +0000 (06:23 +0000)
    FcConfigAcceptFont check for cached fonts up to directory cache read
    time, rather than running it for each font.

ChangeLog
src/fccache.c
src/fccfg.c

index 0c577e43e4e9c9dc824b0b3c6f1508a26188e9f8..39de7e67e33a551ceb1dc94edbb5e76bb906363e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-11-29  Patrick Lam  <plam@mit.edu>
+       * src/fccfg.c (FcConfigBuildFonts):
+       * src/fccache.c (FcCacheReadDirs):
+
+       Make the perf guys hate me a bit less: hoist the directory-name
+       FcConfigAcceptFont check for cached fonts up to directory cache
+       read time, rather than running it for each font.
+
 2005-11-29  Patrick Lam  <plam@mit.edu>
        * src/fccfg.c (FcConfigBuildFonts):
        * src/fcint.h:
index 353bf65f7e324bfe11338a9994b59f02bdff86e8..00948c3b51b3a336f567c86680bcbc0e208e7db7 100644 (file)
@@ -624,6 +624,9 @@ FcCacheReadDirs (FcConfig * config, FcGlobalCache * cache,
      */
     while ((dir = FcStrListNext (list)))
     {
+       if (!FcConfigAcceptFilename (config, dir))
+           continue;
+
        /* freed below */
        file = (FcChar8 *) malloc (strlen ((char *) dir) + 1 + FC_MAX_FILE_LEN + 1);
        if (!file)
index 00510e5a66d0de5cba6c6cbd18ffdbc74d234a91..56c1a3e3d026c8fa096a8dfebaee2aeb6d9323cd 100644 (file)
@@ -308,13 +308,11 @@ FcConfigBuildFonts (FcConfig *config)
 
        for (i = 0; i < cached_fonts->nfont; i++)
        {
-           FcChar8     *cfn, *cfd
+           FcChar8     *cfn; 
            FcPatternGetString (cached_fonts->fonts[i], FC_FILE, 0, &cfn);
-           cfd = (FcChar8 *)FcCacheFindBankDir (cached_fonts->fonts[i]->bank);
 
            if (FcConfigAcceptFont (config, cached_fonts->fonts[i]) &&
-                (cfn && FcConfigAcceptFilename (config, cfn)) &&
-               (cfd && FcConfigAcceptFilename (config, cfd)))
+                (cfn && FcConfigAcceptFilename (config, cfn)))
                FcFontSetAdd (fonts, cached_fonts->fonts[i]);
 
            cached_fonts->fonts[i] = 0; /* prevent free in FcFontSetDestroy */