summaryrefslogtreecommitdiff
path: root/fc-cache
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2013-12-05 19:15:47 +0900
committerAkira TAGOH <akira@tagoh.org>2013-12-20 11:57:16 +0900
commit7a6622f25cdfab5ab775324bef1833b67109801b (patch)
treeb86ccd5635d4171da698caf3d7c47fed5d10cc36 /fc-cache
parent5c725f2f5829238d16116f782d00d8bb0defaf08 (diff)
Improve the performance issue on rescanning directories
Diffstat (limited to 'fc-cache')
-rw-r--r--fc-cache/fc-cache.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c
index bf3b6b48..99e0e9f4 100644
--- a/fc-cache/fc-cache.c
+++ b/fc-cache/fc-cache.c
@@ -187,8 +187,13 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
if (!cache)
{
- (*changed)++;
- cache = FcDirCacheRead (dir, FcTrue, config);
+ if (!recursive)
+ cache = FcDirCacheRescan (dir, config);
+ else
+ {
+ (*changed)++;
+ cache = FcDirCacheRead (dir, FcTrue, config);
+ }
if (!cache)
{
fprintf (stderr, "%s: error scanning\n", dir);
@@ -386,6 +391,7 @@ main (int argc, char **argv)
ret += scanDirs (list, config, FcTrue, really_force, verbose, FcFalse, &changed, NULL);
FcStrListDone (list);
}
+ FcStrSetDestroy (updateDirs);
/*
* Try to create CACHEDIR.TAG anyway.