diff options
Diffstat (limited to 'src/cache/ftcmru.c')
-rw-r--r-- | src/cache/ftcmru.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/cache/ftcmru.c b/src/cache/ftcmru.c index 67227033e..fb1693dae 100644 --- a/src/cache/ftcmru.c +++ b/src/cache/ftcmru.c @@ -329,29 +329,23 @@ FTC_MruNode_CompareFunc selection, FT_Pointer key ) { - FTC_MruNode first, node, next; + FTC_MruNode first = list->nodes; + FTC_MruNode node, next; - first = list->nodes; - while ( first && ( !selection || selection( first, key ) ) ) - { - FTC_MruList_Remove( list, first ); - first = list->nodes; - } + if ( !first || !selection ) + return; - if ( first ) + next = first; + do { - node = first->next; - while ( node != first ) - { - next = node->next; + node = next; + next = node->next; - if ( selection( node, key ) ) - FTC_MruList_Remove( list, node ); + if ( selection( node, key ) ) + FTC_MruList_Remove( list, node ); - node = next; - } - } + } while ( next != first ); } |