Skip to content

Commit

Permalink
We can't compare None with a number, so check that case, otherwise we…
Browse files Browse the repository at this point in the history
… get: TypeError: unorderable types: int() > NoneType()

- tests were failing because of this
  • Loading branch information
JonathanWylie committed Jul 4, 2016
1 parent 071f6af commit e2d3911
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hyperloglog/shll.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ def add(self, timestamp, value):
tmp2 = list(heapq.merge(self.LPFM[j] if self.LPFM[j] is not None else [], [(timestamp, R)]))

for t, R in reversed(tmp2):
if tmax is None:
tmax = t
if tmax is None:
tmax = t

if t < (tmax - self.window):
break
if t < (tmax - self.window):
break

if R > Rmax:
tmp.append((t, R))
Rmax = R
if Rmax is None or R > Rmax:
tmp.append((t, R))
Rmax = R

tmp.reverse()
self.LPFM[j] = tuple(tmp) if tmp else None
Expand Down

0 comments on commit e2d3911

Please sign in to comment.