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

Function GetLongetsOpenSpan

libs/editor/opening_hours_ui.cpp:99–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99osmoh::Timespan GetLongetsOpenSpan(osmoh::Timespan const & openingTime, osmoh::TTimespans const & excludeTime)
100{
101 if (excludeTime.empty())
102 return openingTime;
103
104 osmoh::Timespan longestSpan{openingTime.GetStart(), excludeTime.front().GetStart()};
105 for (size_t i = 0; i + 1 < excludeTime.size(); ++i)
106 {
107 osmoh::Timespan nextOpenSpan{excludeTime[i].GetEnd(), excludeTime[i + 1].GetStart()};
108 longestSpan = SpanLength(longestSpan) > SpanLength(nextOpenSpan) ? longestSpan : nextOpenSpan;
109 }
110
111 osmoh::Timespan lastSpan{excludeTime.back().GetEnd(), openingTime.GetEnd()};
112 return SpanLength(longestSpan) > SpanLength(lastSpan) ? longestSpan : lastSpan;
113}
114} // namespace
115
116namespace editor

Callers 1

Calls 7

SpanLengthFunction · 0.85
frontMethod · 0.80
backMethod · 0.80
emptyMethod · 0.45
GetStartMethod · 0.45
sizeMethod · 0.45
GetEndMethod · 0.45

Tested by

no test coverage detected