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

Function IsR1IncludesR2

3party/opening_hours/rules_evaluation.cpp:374–385  ·  view source on GitHub ↗

Check if r1 is more general range and includes r2.

Source from the content-addressed store, hash-verified

372
373/// Check if r1 is more general range and includes r2.
374bool IsR1IncludesR2(RuleSequence const & r1, RuleSequence const & r2)
375{
376 /// @todo Very naive implementation, but ok in most cases.
377 if ((r1.GetYears().empty() && !r2.GetYears().empty()) ||
378 (r1.GetMonths().empty() && !r2.GetMonths().empty()) ||
379 (r1.GetWeeks().empty() && !r2.GetWeeks().empty()) ||
380 (r1.GetWeekdays().IsEmpty() && !r2.GetWeekdays().IsEmpty()))
381 {
382 return true;
383 }
384 return false;
385}
386
387bool IsActive(RuleSequence const & rule, time_t const timestamp)
388{

Callers 1

GetStateFunction · 0.85

Calls 2

emptyMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected