From 1b500973e6efd0948e6452f42feed193259906c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Fortin=20Tam?= Date: Fri, 2 Aug 2024 20:14:22 -0400 Subject: [PATCH] month-cell: Simplify calls to day_of_month We already had this local variable waiting to be used; let's reuse it to avoid calling querying the date repeatedly. Part-of: --- src/gui/views/gcal-month-cell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/views/gcal-month-cell.c b/src/gui/views/gcal-month-cell.c index cf92466b..99f524b8 100644 --- a/src/gui/views/gcal-month-cell.c +++ b/src/gui/views/gcal-month-cell.c @@ -473,16 +473,16 @@ gcal_month_cell_set_date (GcalMonthCell *self, gcal_clear_date_time (&self->date); self->date = g_date_time_ref (date); + day_of_month = g_date_time_get_day_of_month (date); /* Day label */ - text = g_strdup_printf ("%d", g_date_time_get_day_of_month (date)); + text = g_strdup_printf ("%d", day_of_month); gtk_label_set_text (self->day_label, text); update_style_flags (self); add_month_separators (self); /* Month name */ - day_of_month = g_date_time_get_day_of_month (date); gtk_widget_set_visible (GTK_WIDGET (self->month_name_label), day_of_month == 1); if (day_of_month == 1) {