From e7f42857bbb191140bd9985dd50ce76ad7fd7e3a Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Mon, 5 Aug 2019 13:48:09 +0100 Subject: [PATCH] Refactor return value so we don't create identical lists each time. --- synapse/handlers/device.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py index 4fef2aef0c..ff198d0a3e 100644 --- a/synapse/handlers/device.py +++ b/synapse/handlers/device.py @@ -216,11 +216,11 @@ class DeviceWorkerHandler(BaseHandler): possibly_joined = [] possibly_left = [] - opentracing.log_kv( - {"changed": list(possibly_joined), "left": list(possibly_left)} - ) + result = {"changed": list(possibly_joined), "left": list(possibly_left)} - return {"changed": list(possibly_joined), "left": list(possibly_left)} + opentracing.log_kv(result) + + return {result} class DeviceHandler(DeviceWorkerHandler):