1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-10 05:23:37 -04: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:
Miciah Dashiel Butler Masters 2006-10-15 21:33:56 +00:00 committed by Miciah Dashiel Butler Masters
parent 28261fcfba
commit 3041ef5ff1

View File

@ -285,7 +285,7 @@ shrink_format_cache(int whole)
assertm(format_cache_entries >= 0, "format_cache_entries underflow on entry");
if_assert_failed format_cache_entries = 0;
foreachback (document, format_cache) {
foreachbacksafe (document, next, format_cache) {
if (is_object_used(document)) continue;
/* 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)
break;
/* Jump back to already processed entry (or list head), and let
* the foreachback move it to the next entry to go. */
document = document->next;
done_document(document->prev);
done_document(document);
format_cache_entries--;
}