comply with coding style

This commit is contained in:
stephane soulier 2019-03-08 17:03:56 +01:00
parent fa3fd729d1
commit 92ca7aee12

View File

@ -122,9 +122,10 @@ class Stream(BaseModel):
self.tags = {}
step = 2**128 // shard_count
for index, start, end in itertools.chain(
map(lambda i: (i, i*step, (i+1) * step), range(shard_count - 1)),
[(shard_count - 1, (shard_count -1) * step, 2**128)]):
hash_ranges = itertools.chain(map(lambda i: (i, i * step, (i + 1) * step),
range(shard_count - 1)),
[(shard_count - 1, (shard_count - 1) * step, 2**128)])
for index, start, end in hash_ranges:
shard = Shard(index, start, end)
self.shards[shard.shard_id] = shard