Commit 3ea70f93 authored by Alexander Larsson's avatar Alexander Larsson Committed by Akira TAGOH

Cache: Remove alias_table

There is really no need for this anymore

https://bugs.freedesktop.org/show_bug.cgi?id=106618
parent c42402d0
......@@ -278,26 +278,22 @@ static FcChar8 *
FcDirCacheBasenameUUID (const FcChar8 *dir, FcChar8 cache_base[CACHEBASE_LEN], FcConfig *config)
{
void *u;
FcChar8 *alias, *target;
FcChar8 *target;
const FcChar8 *sysroot = FcConfigGetSysRoot (config);
if (!FcHashTableFind (config->alias_table, dir, (void **)&alias))
alias = FcStrdup (dir);
if (sysroot)
target = FcStrBuildFilename (sysroot, alias, NULL);
target = FcStrBuildFilename (sysroot, dir, NULL);
else
target = FcStrdup (alias);
target = FcStrdup (dir);
if (FcHashTableFind (config->uuid_table, target, &u))
{
uuid_unparse (u, (char *) cache_base);
strcat ((char *) cache_base, "-" FC_ARCHITECTURE FC_CACHE_SUFFIX);
FcHashUuidFree (u);
FcStrFree (target);
FcStrFree (alias);
return cache_base;
}
FcStrFree (target);
FcStrFree (alias);
return NULL;
}
#endif
......@@ -1017,7 +1013,6 @@ FcCache *
FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file)
{
FcCache *cache = NULL;
const FcChar8 *d;
#ifndef _WIN32
FcDirCacheReadUUID ((FcChar8 *) dir, config);
......@@ -1027,10 +1022,6 @@ FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file)
&cache, cache_file))
return NULL;
d = FcCacheDir (cache);
if (FcStrCmp (dir, d))
FcHashTableAdd (config->alias_table, (FcChar8 *) d, (FcChar8 *) dir);
return cache;
}
......
......@@ -144,12 +144,6 @@ FcConfigCreate (void)
FcHashUuidCopy,
(FcDestroyFunc) FcStrFree,
FcHashUuidFree);
config->alias_table = FcHashTableCreate ((FcHashFunc) FcStrHashIgnoreCase,
(FcCompareFunc) FcStrCmp,
FcHashStrCopy,
FcHashStrCopy,
(FcDestroyFunc) FcStrFree,
(FcDestroyFunc) FcStrFree);
FcRefInit (&config->ref, 1);
......@@ -313,7 +307,6 @@ FcConfigDestroy (FcConfig *config)
FcStrFree (config->sysRoot);
FcHashTableDestroy (config->uuid_table);
FcHashTableDestroy (config->alias_table);
free (config);
}
......@@ -398,18 +391,14 @@ FcConfigAddCache (FcConfig *config, FcCache *cache,
for (i = 0; i < cache->dirs_count; i++)
{
const FcChar8 *dir = FcCacheSubdir (cache, i);
FcChar8 *alias;
FcChar8 *d = FcStrDirname (dir);
FcChar8 *s = NULL;
if (FcHashTableFind (config->alias_table, d, (void **)&alias))
if (relocated)
{
FcChar8 *base = FcStrBasename (dir);
dir = s = FcStrBuildFilename (alias, base, NULL);
FcStrFree (alias);
dir = s = FcStrBuildFilename (forDir, base, NULL);
FcStrFree (base);
}
FcStrFree (d);
if (FcConfigAcceptFilename (config, dir))
FcStrSetAddFilename (dirSet, dir);
if (s)
......
......@@ -566,7 +566,6 @@ struct _FcConfig {
FcStrSet *availConfigFiles; /* config files available */
FcPtrList *rulesetList; /* List of rulesets being installed */
FcHashTable *uuid_table; /* UUID table for cachedirs */
FcHashTable *alias_table; /* alias table for cachedirs */
};
typedef struct _FcFileTime {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment