Refactor payload return to list comprehension
This commit is contained in:
parent
ead62d5671
commit
7fd83b05b9
1 changed files with 1 additions and 6 deletions
|
@ -20,9 +20,4 @@ def read_payload(payload):
|
||||||
if message == b"":
|
if message == b"":
|
||||||
break
|
break
|
||||||
data += message
|
data += message
|
||||||
parsed_data = []
|
return [ujson.loads(row) for row in data.split(b"\n") if row]
|
||||||
for row in data.split(b"\n"):
|
|
||||||
if not row.strip():
|
|
||||||
continue
|
|
||||||
parsed_data.append(ujson.loads(row))
|
|
||||||
return parsed_data
|
|
||||||
|
|
Reference in a new issue