Skip to content

Commit ffa9a1a

Browse files
committed
address review comments
1 parent f592a59 commit ffa9a1a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/interval_sets.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,12 @@ end
471471
"""
472472
find_intersections(x, y)
473473
474-
Returns a `Vector{Vector{Int}}` where the value at index `i` gives the indices to all
475-
intervals in `y` that intersect with `x[i]`. Calls collect on the arguments if they
476-
aren't already arrays.
474+
Find the intervals in `y` that intersect with intervals in `x`. Returns a vector, `z`, where
475+
each element `z[i]` is a vector of all indices in `y` that intersect with `x[i]`. The values
476+
`x` and `y` should be iterables of intervals.
477477
"""
478478
find_intersections(x, y) = find_intersections_(collect(x), collect(y))
479+
find_intersections(x::AbstractVector, y::Abstractvector) = find_intersections_(x, y)
479480
function find_intersections_(x::AbstractVector, y::AbstractVector)
480481
(isempty(x) || isempty(y)) && return Vector{Int}[]
481482
tracking = endpoint_tracking(x, y)

test/sets.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ end
5454
@test isempty(find_intersections([], []))
5555
@test_throws MethodError find_intersections([1], [2])
5656
@test isempty(find_intersections(Interval[], Interval[]))
57-
@test isempty(find_intersections([1..3], Interval[]))
58-
@test isempty(find_intersections(Interval[], [1..3]))
57+
@test isempty(find_intersections([1..3], []))
58+
@test isempty(find_intersections([], [1..3]))
5959

6060
function testsets(a, b)
6161
@test area(a b) area(myunion(a)) + area(myunion(b))

0 commit comments

Comments
 (0)