mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Use foreachbacksafe in shrink_format_cache
I hope that it isn't too confusing to re-use the local variable next with foreachbacksafe.
This commit is contained in:
parent
28261fcfba
commit
3041ef5ff1
@ -285,7 +285,7 @@ shrink_format_cache(int whole)
|
|||||||
assertm(format_cache_entries >= 0, "format_cache_entries underflow on entry");
|
assertm(format_cache_entries >= 0, "format_cache_entries underflow on entry");
|
||||||
if_assert_failed format_cache_entries = 0;
|
if_assert_failed format_cache_entries = 0;
|
||||||
|
|
||||||
foreachback (document, format_cache) {
|
foreachbacksafe (document, next, format_cache) {
|
||||||
if (is_object_used(document)) continue;
|
if (is_object_used(document)) continue;
|
||||||
|
|
||||||
/* If we are not purging the whole format cache, stop
|
/* If we are not purging the whole format cache, stop
|
||||||
@ -293,10 +293,7 @@ shrink_format_cache(int whole)
|
|||||||
if (!whole && format_cache_entries <= format_cache_size)
|
if (!whole && format_cache_entries <= format_cache_size)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Jump back to already processed entry (or list head), and let
|
done_document(document);
|
||||||
* the foreachback move it to the next entry to go. */
|
|
||||||
document = document->next;
|
|
||||||
done_document(document->prev);
|
|
||||||
format_cache_entries--;
|
format_cache_entries--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user