imip-agent

Change of imiptools/period.py

170:86708cc73d28
imiptools/period.py
     1.1 --- a/imiptools/period.py	Sun Jan 25 00:29:40 2015 +0100
     1.2 +++ b/imiptools/period.py	Sun Jan 25 00:55:38 2015 +0100
     1.3 @@ -226,8 +226,8 @@
     1.4  
     1.5      """
     1.6      Introduce into the 'slots' entries for those in 'points' that are not
     1.7 -    already present, propagating active periods from time points preceding and
     1.8 -    succeeding those added.
     1.9 +    already present, propagating active periods from time points preceding
    1.10 +    those added.
    1.11      """
    1.12  
    1.13      new_slots = []
    1.14 @@ -237,18 +237,7 @@
    1.15          if i < len(slots) and slots[i][0] == point:
    1.16              continue
    1.17  
    1.18 -        previously_active = i > 0 and slots[i-1] or []
    1.19 -        subsequently_active = i < len(slots) and slots[i] or []
    1.20 -
    1.21 -        active = []
    1.22 -
    1.23 -        for p, s in zip(previously_active, subsequently_active):
    1.24 -            if p == s:
    1.25 -                active.append(p)
    1.26 -            else:
    1.27 -                active.append(None)
    1.28 -
    1.29 -        new_slots.append((point, active))
    1.30 +        new_slots.append((point, i > 0 and slots[i-1][1] or []))
    1.31  
    1.32      for t in new_slots:
    1.33          insort_left(slots, t)