mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-10 10:51:08 +00:00
solver: Reduce two small loops into a comprehension
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
d3e06fc45f
commit
16dc303190
@ -16,6 +16,7 @@
|
||||
|
||||
import logging
|
||||
from collections import deque
|
||||
from itertools import chain
|
||||
|
||||
from britney2.utils import (ifilter_only, iter_except)
|
||||
|
||||
@ -237,15 +238,9 @@ class InstallabilitySolver(object):
|
||||
# that migrates based on various rules.
|
||||
for (item, adds, rms) in groups:
|
||||
key = str(item)
|
||||
oldcons = set()
|
||||
newcons = set()
|
||||
for r in rms:
|
||||
oldcons.update(universe.negative_dependencies_of(r))
|
||||
for a in adds:
|
||||
newcons.update(universe.negative_dependencies_of(a))
|
||||
current = newcons & oldcons
|
||||
oldcons -= current
|
||||
newcons -= current
|
||||
oldcons = set(chain.from_iterable(universe.negative_dependencies_of(r) for r in rms))
|
||||
newcons = set(chain.from_iterable(universe.negative_dependencies_of(a) for a in adds))
|
||||
oldcons -= newcons
|
||||
if oldcons:
|
||||
# Some of the old binaries have "conflicts" that will
|
||||
# be removed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user