Fix a corner case where one time range was entirely contained with another, could lead to other overlaps not being noticed

This commit is contained in:
Juhani Haverinen 2016-10-08 22:55:52 +03:00
parent 50dab6c0eb
commit 52dd3bc1c4
1 changed files with 8 additions and 1 deletions

View File

@ -72,4 +72,11 @@ def main():
if previous_time_range is not None:
if time_range.overlaps(previous_time_range):
previous_time_range = time_range
# If the current's ending time is before the previous's, don't change previous_time_range in case it overlaps with several
# If current's ending time after, it's safe to change
if time_range.range()[1] >= previous_time_range.range()[1]:
previous_time_range = time_range
previous_time_range = time_range
previous_time_range = time_range