summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2023-05-12 22:27:08 -0400
committerAlexei Podtelezhnikov <apodtele@gmail.com>2023-05-12 22:27:08 -0400
commite1a4e081aa57b3e044c7f30c3118cb6015e397d6 (patch)
tree824664a2232358929ecd2915792d99e63670cc42
parent771ff8bd03e5e2e5faae51aea22dfde2dc1522cc (diff)
downloadfreetype2-e1a4e081aa57b3e044c7f30c3118cb6015e397d6.tar.gz
[cache] Merge functions.
* src/cache/ftccache.c (FTC_Cache_Init): Merge into... (ftc_cache_done): ... this function, with unnecessary checks removed.
-rw-r--r--src/cache/ftccache.c47
1 files changed, 17 insertions, 30 deletions
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index e77c1468f..e0698557b 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -319,13 +319,6 @@
FT_LOCAL_DEF( FT_Error )
- FTC_Cache_Init( FTC_Cache cache )
- {
- return ftc_cache_init( cache );
- }
-
-
- FT_LOCAL_DEF( FT_Error )
ftc_cache_init( FTC_Cache cache )
{
FT_Memory memory = cache->memory;
@@ -341,10 +334,20 @@
}
- static void
- FTC_Cache_Clear( FTC_Cache cache )
+ FT_LOCAL_DEF( FT_Error )
+ FTC_Cache_Init( FTC_Cache cache )
+ {
+ return ftc_cache_init( cache );
+ }
+
+
+ FT_LOCAL_DEF( void )
+ ftc_cache_done( FTC_Cache cache )
{
- if ( cache && cache->buckets )
+ FT_Memory memory = cache->memory;
+
+
+ if ( cache->buckets )
{
FTC_Manager manager = cache->manager;
FT_UFast count = cache->p;
@@ -370,30 +373,14 @@
cache->clazz.node_free( node, cache );
node = next;
}
- cache->buckets[i] = NULL;
}
- ftc_cache_resize( cache );
}
- }
+ FT_FREE( cache->buckets );
- FT_LOCAL_DEF( void )
- ftc_cache_done( FTC_Cache cache )
- {
- if ( cache->memory )
- {
- FT_Memory memory = cache->memory;
-
-
- FTC_Cache_Clear( cache );
-
- FT_FREE( cache->buckets );
- cache->mask = 0;
- cache->p = 0;
- cache->slack = 0;
-
- cache->memory = NULL;
- }
+ cache->p = 0;
+ cache->mask = 0;
+ cache->slack = 0;
}