From ebd8028bf3eeb2e364e8fc651d628333d48f10b7 Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Sun, 24 Jan 2021 18:53:44 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- gendiff/comparator.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gendiff/comparator.py b/gendiff/comparator.py index caa7e22..9c27567 100644 --- a/gendiff/comparator.py +++ b/gendiff/comparator.py @@ -15,12 +15,10 @@ # * Fixed WPS441, WPS440 to allow variable names to be reused in multiple loops # * https://github.com/wemake-services/wemake-python-styleguide/pull/1768#pullrequestreview-550906165 # noqa:E501 def compile_diff(first_data_set, second_data_set): - diff = {} keys_intersection = first_data_set.keys() & second_data_set.keys() - for data_key in keys_intersection: - diff[data_key] = compare_same_keys( + diff = {data_key: compare_same_keys( first_data_set.get(data_key), second_data_set.get(data_key), - ) + ) for data_key in keys_intersection} keys_removed = first_data_set.keys() - second_data_set.keys() for data_key in keys_removed: # noqa:WPS440 diff[data_key] = {STATUS: REMOVED, VALUE: first_data_set.get(data_key)} # noqa:WPS441, E501