1.1 --- a/imiptools/data.py Tue Oct 24 23:24:41 2017 +0200
1.2 +++ b/imiptools/data.py Wed Oct 25 00:09:19 2017 +0200
1.3 @@ -1278,19 +1278,13 @@
1.4
1.5 # Return a sorted list of the periods.
1.6
1.7 - periods = list(MergingIterator([rule_periods, iter(rdates or [])]))
1.8 + periods = MergingIterator([rule_periods, iter(rdates or [])])
1.9
1.10 # Exclude exception dates.
1.11
1.12 - exdates = obj.get_date_value_item_periods("EXDATE", obj_tzid or tzid)
1.13 + exdates = set(obj.get_date_value_item_periods("EXDATE", obj_tzid or tzid) or [])
1.14
1.15 - if exdates:
1.16 - for period in exdates:
1.17 - i = bisect_left(periods, period)
1.18 - while i < len(periods) and periods[i] == period:
1.19 - del periods[i]
1.20 -
1.21 - return periods
1.22 + return filter(lambda p, excluded=exdates: p not in excluded, periods)
1.23
1.24 def get_sender_identities(mapping):
1.25