Skip to content

Commit 29f60b3

Browse files
authored
Merge pull request #33 from invenia/rf/endpoint-equality
Add equality for matching left/right endpoints
2 parents 0ab1091 + 6f96d4f commit 29f60b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/endpoint.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ Visualizing two touching intervals can assist in understanding this logic:
4343
[x..y](y..z] -> RightEndpoint != LeftEndpoint
4444
[x..y)(y..z] -> RightEndpoint != LeftEndpoint
4545
"""
46-
Base.:(==)(a::Endpoint, b::Endpoint)
47-
46+
function Base.:(==)(a::Endpoint, b::Endpoint)
47+
a.endpoint == b.endpoint && a.included == b.included
48+
end
4849

4950
function Base.:(==)(a::LeftEndpoint{T}, b::RightEndpoint{T}) where T
5051
a.endpoint == b.endpoint && a.included && b.included

0 commit comments

Comments
 (0)