MCPcopy Create free account
hub / github.com/comaps/comaps / NextWeekdayNumber

Function NextWeekdayNumber

libs/editor/ui2oh.cpp:78–86  ·  view source on GitHub ↗

Shifts values from 1 to 7 like this: 1 2 3 4 5 6 7 -> 2 3 4 5 6 7 1

Source from the content-addressed store, hash-verified

76
77// Shifts values from 1 to 7 like this: 1 2 3 4 5 6 7 -> 2 3 4 5 6 7 1
78int32_t NextWeekdayNumber(osmoh::Weekday const wd)
79{
80 auto dayNumber = WeekdayNumber(wd);
81 // If first element of the gourp would be evaluated to 0
82 // the resulting formula whould be (dayNumber + 1) % kDaysInWeek.
83 // Since the first one evaluates to 1
84 // the formula is:
85 return dayNumber % kDaysInWeek + 1;
86}
87
88// Returns a vector of Weekdays with no gaps and with Sunday as the last day.
89// Exampls:

Callers 2

RemoveInversionFunction · 0.85
SplitIntoIntervalsFunction · 0.85

Calls 1

WeekdayNumberFunction · 0.85

Tested by

no test coverage detected