listlistmodel: Add a cache
authorBenjamin Otte <otte@redhat.com>
Sat, 15 Apr 2023 03:24:29 +0000 (05:24 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 15 Apr 2023 03:27:47 +0000 (05:27 +0200)
commite010cd242c577fa4da3b05f67728dcbbe1781cb3
tree8903809a1d8f7e5ba7b6df1a8e03c5c8fb7f75c1
parent41454b63b41a05e1cb593a77d67fb20a26ca5510
listlistmodel: Add a cache

Cache the last looked up item and use it for looking up the next item if
it's closest. This massively speeds up iteration over the model, because
each call to get_item() will be adjacent to the previous one.

Improves performance of the inspector quite a bit.
gtk/gtklistlistmodel.c