From 7fd15eab4f9bd6e4781b3f97147536c34b2616ba Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 30 Sep 2018 16:31:21 +0000 Subject: [PATCH] britney: Use chain rather then duplicate statement Signed-off-by: Niels Thykier --- britney.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/britney.py b/britney.py index 0a5171d..790fe71 100755 --- a/britney.py +++ b/britney.py @@ -186,6 +186,7 @@ import sys import time from collections import defaultdict from functools import reduce +from itertools import chain from operator import attrgetter from urllib.parse import quote @@ -2732,8 +2733,7 @@ class Britney(object): for item, ver in items: # excuses which depend on "item" or are depended on by it - new_items = set((x, excuses[x].ver[1]) for x in excuses_deps[item]) - new_items.update((x, excuses[x].ver[1]) for x in excuses_rdeps[item]) + new_items = {(x, excuses[x].ver[1]) for x in chain(excuses_deps[item], excuses_rdeps[item])} new_items -= seen_items items.extend(new_items) seen_items.update(new_items)