solver: Invert an if-statement to reduce max indentation level

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 6 years ago
parent 68407c53c0
commit b61e1086bd
No known key found for this signature in database
GPG Key ID: A65B78DBE67C7AAC

@ -267,18 +267,20 @@ class InstallabilitySolver(object):
scc_id = com[0]
scc[scc_id] = com
merged[scc_id] = scc_id
if len(com) > 1:
so_before = order[scc_id]['before']
so_after = order[scc_id]['after']
for n in com:
if n == scc_id:
continue
so_before.update(order[n]['before'])
so_after.update(order[n]['after'])
merged[n] = scc_id
del order[n]
if debug_solver: # pragma: no cover
self.logger.debug("SCC: %s -- %s", scc_id, str(sorted(com)))
if len(com) < 2:
# Trivial case
continue
so_before = order[scc_id]['before']
so_after = order[scc_id]['after']
for n in com:
if n == scc_id:
continue
so_before.update(order[n]['before'])
so_after.update(order[n]['after'])
merged[n] = scc_id
del order[n]
if debug_solver: # pragma: no cover
self.logger.debug("SCC: %s -- %s", scc_id, str(sorted(com)))
for com in comps:
node = com[0]

Loading…
Cancel
Save