Add a two-argument shortest_timespan_containing method. It's not uncommon to want merge exactly two TimeSpans, but currently you have to wrap them in an interator in order to pass them to shortest_timespan_containing. This commit adds a method to the function that accepts two TimeSpans and otherwise does what it says on the tin. It is only part of this PR because I wanted to use it to implement the other functions.
Define merge_spans!(predicate, spans), which merges the timespans in spans, modifying and resizing it in-place.
Define merge_spans(predicate, spans) for an out-of-place analogue.
There are four distinct commits
shortest_timespan_containing
method. It's not uncommon to want merge exactly twoTimeSpan
s, but currently you have to wrap them in an interator in order to pass them toshortest_timespan_containing
. This commit adds a method to the function that accepts twoTimeSpan
s and otherwise does what it says on the tin. It is only part of this PR because I wanted to use it to implement the other functions.merge_spans!(predicate, spans)
, which merges the timespans inspans
, modifying and resizing it in-place.merge_spans(predicate, spans)
for an out-of-place analogue.