summaryrefslogtreecommitdiff
path: root/gtk/gtklistitembase.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2023-04-10 23:17:41 +0200
committerBenjamin Otte <otte@redhat.com>2023-05-09 17:00:40 +0200
commit03ac6611c1ec623aba3cab8cd1e50914d2099351 (patch)
tree262e8cfedbb06888ec1addfec09aab3d7dfa81d3 /gtk/gtklistitembase.c
parent0ff88346cd991f14c3158411dc7b4d1d48b26262 (diff)
downloadgtk+-03ac6611c1ec623aba3cab8cd1e50914d2099351.tar.gz
listitembase: exit early
When update() is called but no values are changed, exit early.
Diffstat (limited to 'gtk/gtklistitembase.c')
-rw-r--r--gtk/gtklistitembase.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtklistitembase.c b/gtk/gtklistitembase.c
index 67bbf95912..cdd8fe9703 100644
--- a/gtk/gtklistitembase.c
+++ b/gtk/gtklistitembase.c
@@ -81,6 +81,11 @@ gtk_list_item_base_update (GtkListItemBase *self,
GtkListItemBasePrivate *priv = gtk_list_item_base_get_instance_private (self);
gboolean was_selected;
+ if (priv->position == position &&
+ priv->item == item &&
+ priv->selected == selected)
+ return;
+
was_selected = priv->selected;
GTK_LIST_ITEM_BASE_GET_CLASS (self)->update (self, position, item, selected);