Skip to content

Commit

Permalink
Merge dd020c1 into 630d3cb
Browse files Browse the repository at this point in the history
  • Loading branch information
jefftrull authored Sep 11, 2021
2 parents 630d3cb + dd020c1 commit 46bf5f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion portion/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,11 @@ def __and__(self, other):
if not isinstance(other, Interval):
return NotImplemented

if self.atomic and other.atomic:
if (self.upper < other.lower) or (self.lower > other.upper):
# early out for non-overlapping intervals
intersections = []
return self.__class__(*intersections)
elif self.atomic and other.atomic:
if self.lower == other.lower:
lower = self.lower
left = self.left if self.left == Bound.OPEN else other.left
Expand Down

0 comments on commit 46bf5f1

Please sign in to comment.