Refactor payload return to list comprehension

This commit is contained in:
Jake Howard 2018-12-08 14:23:34 +00:00
parent ead62d5671
commit 7fd83b05b9
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -20,9 +20,4 @@ def read_payload(payload):
if message == b"":
break
data += message
parsed_data = []
for row in data.split(b"\n"):
if not row.strip():
continue
parsed_data.append(ujson.loads(row))
return parsed_data
return [ujson.loads(row) for row in data.split(b"\n") if row]