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:
@@ -25,6 +25,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
#include "gcal-alarm-row.h"
|
||||
#include "gcal-utils.h"
|
||||
|
||||
struct _GcalAlarmRow
|
||||
{
|
||||
@@ -63,7 +64,7 @@ format_alarm_duration (ICalDuration *duration)
|
||||
guint hours;
|
||||
guint days;
|
||||
|
||||
days = i_cal_duration_get_weeks (duration) * 7 + i_cal_duration_get_days (duration);
|
||||
days = i_cal_duration_get_weeks (duration) * N_WEEKDAYS + i_cal_duration_get_days (duration);
|
||||
hours = i_cal_duration_get_hours (duration);
|
||||
minutes = i_cal_duration_get_minutes (duration);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user