[libhandy/wip/exalm/paginator-animate: 36/41] carousel-box: Use for loop in forall()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/wip/exalm/paginator-animate: 36/41] carousel-box: Use for loop in forall()
- Date: Wed, 27 May 2020 15:55:00 +0000 (UTC)
commit bf14cfe0d60e14264f28c446fc2f54056f5fe917
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sun Dec 29 19:29:49 2019 +0500
carousel-box: Use for loop in forall()
A small cleanup.
Signed-off-by: Alexander Mikhaylenko <alexm gnome org>
src/hdy-carousel-box.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/hdy-carousel-box.c b/src/hdy-carousel-box.c
index 1643f9b8..64a8eb3e 100644
--- a/src/hdy-carousel-box.c
+++ b/src/hdy-carousel-box.c
@@ -698,16 +698,14 @@ hdy_carousel_box_forall (GtkContainer *container,
gpointer callback_data)
{
HdyCarouselBox *self = HDY_CAROUSEL_BOX (container);
- GList *list;
- GtkWidget *child;
+ g_autoptr (GList) children = NULL;
+ GList *l;
- list = self->children;
- while (list) {
- HdyCarouselBoxChildInfo *child_info = list->data;
- child = child_info->widget;
- list = list->next;
+ children = g_list_copy (self->children);
+ for (l = children; l; l = l->next) {
+ HdyCarouselBoxChildInfo *child = l->data;
- (* callback) (child, callback_data);
+ (* callback) (child->widget, callback_data);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]