From db50cbdaf592349c204ab0af0e7061ea72237044 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 27 Aug 2006 18:19:39 -0700 Subject: Eliminate NormalizeDir. Eliminate gratuitous stat/access calls per dir. Normalized directory names offer protection against looped directory trees but cost enormous numbers of system calls (stat per file in the hierarchy). Also, cache file directory name contents are validated each time the directory is modified, don't re-validate every time the cache file is loaded with an access and stat call. --- fc-cache/fc-cache.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'fc-cache') diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c index 8519388..29974b2 100644 --- a/fc-cache/fc-cache.c +++ b/fc-cache/fc-cache.c @@ -126,7 +126,6 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool { int ret = 0; const FcChar8 *dir; - const FcChar8 *dir_orig; FcFontSet *set; FcStrSet *subdirs; FcStrList *sublist; @@ -136,13 +135,11 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool * Now scan all of the directories into separate databases * and write out the results */ - while ((dir_orig = FcStrListNext (list))) + while ((dir = FcStrListNext (list))) { - dir = FcConfigNormalizeFontDir (config, dir_orig); - if (verbose) { - printf ("%s: \"%s\": ", program, dir ? dir : dir_orig); + printf ("%s: \"%s\": ", program, dir); fflush (stdout); } -- cgit v1.2.3