From 7fd83b05b9293e086b29e671cb1fbd576533cb47 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 8 Dec 2018 14:23:34 +0000 Subject: [PATCH] Refactor payload return to list comprehension --- ipc_unix/utils.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ipc_unix/utils.py b/ipc_unix/utils.py index aa7b908..8c354d2 100644 --- a/ipc_unix/utils.py +++ b/ipc_unix/utils.py @@ -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]