Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/TimeSpans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,13 @@ function invert_spans(spans, parent_span)
end

"""
intersect(span_1, span_2)
intersect(a::TimeSpan, b::TimeSpan)

Returns a timespan that consists of the intersection of two timespans.

Throws an `ArgumentError` if there is not overlap between the spans.
"""
function intersect(a, b)
function intersect(a::TimeSpan, b::TimeSpan)
overlaps(a, b) || throw(ArgumentError("provided spans must overlap"))
return TimeSpan(max(start(a), start(b)), min(stop(a), stop(b)))
end
Expand Down
Loading