* src/cache/ftccache.c (FTC_Cache_RemoveFaceID): Remove nodes instantly.
This commit is contained in:
parent
a209e1adcd
commit
5962d3c1b9
|
@ -544,7 +544,6 @@
|
||||||
FTC_FaceID face_id )
|
FTC_FaceID face_id )
|
||||||
{
|
{
|
||||||
FTC_Manager manager = cache->manager;
|
FTC_Manager manager = cache->manager;
|
||||||
FTC_Node frees = NULL;
|
|
||||||
FT_UFast count = cache->p;
|
FT_UFast count = cache->p;
|
||||||
FT_UFast i;
|
FT_UFast i;
|
||||||
|
|
||||||
|
@ -557,41 +556,27 @@
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
FTC_Node node = *pnode;
|
FTC_Node node = *pnode;
|
||||||
FT_Bool list_changed = FALSE;
|
|
||||||
|
|
||||||
|
|
||||||
if ( !node )
|
if ( !node )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ( cache->clazz.node_remove_faceid( node, face_id,
|
if ( cache->clazz.node_remove_faceid( node, face_id, cache, NULL ) )
|
||||||
cache, &list_changed ) )
|
|
||||||
{
|
{
|
||||||
*pnode = node->link;
|
*pnode = node->link;
|
||||||
node->link = frees;
|
|
||||||
frees = node;
|
manager->cur_weight -= cache->clazz.node_weight( node, cache );
|
||||||
|
ftc_node_mru_unlink( node, manager );
|
||||||
|
|
||||||
|
cache->clazz.node_free( node, cache );
|
||||||
|
|
||||||
|
cache->slack++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pnode = &node->link;
|
pnode = &node->link;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove all nodes in the free list */
|
|
||||||
while ( frees )
|
|
||||||
{
|
|
||||||
FTC_Node node;
|
|
||||||
|
|
||||||
|
|
||||||
node = frees;
|
|
||||||
frees = node->link;
|
|
||||||
|
|
||||||
manager->cur_weight -= cache->clazz.node_weight( node, cache );
|
|
||||||
ftc_node_mru_unlink( node, manager );
|
|
||||||
|
|
||||||
cache->clazz.node_free( node, cache );
|
|
||||||
|
|
||||||
cache->slack++;
|
|
||||||
}
|
|
||||||
|
|
||||||
ftc_cache_resize( cache );
|
ftc_cache_resize( cache );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue