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

Method ReplaceExcludeTime

libs/editor/opening_hours_ui.cpp:193–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193bool TimeTable::ReplaceExcludeTime(osmoh::Timespan const & span, size_t const index)
194{
195 if (IsTwentyFourHours() || index > m_excludeTime.size())
196 return false;
197
198 auto copy = m_excludeTime;
199 if (index == m_excludeTime.size())
200 copy.push_back(span);
201 else
202 copy[index] = span;
203
204 if (!FixTimeSpans(m_openingTime, copy))
205 return false;
206
207 m_excludeTime.swap(copy);
208 return true;
209}
210
211bool TimeTable::RemoveExcludeTime(size_t const index)
212{

Callers 1

UNIT_TESTFunction · 0.80

Calls 4

FixTimeSpansFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45
swapMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.64