utils: Turn number of weekdays into a macro
While "7" may be obvious in the context of calendaring that it represents the number of week days, it often gives me the impression of it being a magic number when I'm hyperfocused on certain parts of the codebase for several consecutive hours. Turning the number into a macro helps me scan functions much more easily. Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/674>
This commit is contained in:
@@ -111,7 +111,7 @@ add_month_separators (GcalMonthCell *self)
|
||||
gtk_widget_remove_css_class (GTK_WIDGET (self), "separator-side");
|
||||
|
||||
day_of_month = g_date_time_get_day_of_month (self->date);
|
||||
if (day_of_month > 1 && day_of_month <= 7)
|
||||
if (day_of_month > 1 && day_of_month <= N_WEEKDAYS)
|
||||
{
|
||||
gtk_widget_add_css_class (GTK_WIDGET (self), "separator-top");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user