[Fwd: Re: [maybe OT?] Code excerpts from the GIMP]
-------- Forwarded Message --------
> From: Sven Neumann <[hidden email]>
> gimp-2.2.4/app/core/gimppreviewcache.c uses a GSList as a sort of
> size-based queue; it holds image previews in a GSList and uses
> g_slist_insert_sorted to insert the smaller images first. Oddly,
> another function in the same file trims the cache by iterating
> over the same GSList and comparing each item to find the smallest
> one to remove. Might be a possibility for some optimization there.
> The function preview_cache_remove_smallest() which is used to trim the
> cache actually uses a different comparison than what is used to keep
> the list sorted. Whether this is what the author intended, I don't know.
Ah, you're right, it uses the area vs an x1 > x2 and y1 > y2 comparison.
I've corrected that comment, thanks much!