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"":
|
||||
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]
|
||||
|
|
Reference in a new issue