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_id = com[0]
scc[scc_id] = com scc[scc_id] = com
merged[scc_id] = scc_id merged[scc_id] = scc_id
if len(com) > 1: if len(com) < 2:
so_before = order[scc_id]['before'] # Trivial case
so_after = order[scc_id]['after'] continue
for n in com: so_before = order[scc_id]['before']
if n == scc_id: so_after = order[scc_id]['after']
continue for n in com:
so_before.update(order[n]['before']) if n == scc_id:
so_after.update(order[n]['after']) continue
merged[n] = scc_id so_before.update(order[n]['before'])
del order[n] so_after.update(order[n]['after'])
if debug_solver: # pragma: no cover merged[n] = scc_id
self.logger.debug("SCC: %s -- %s", scc_id, str(sorted(com))) del order[n]
if debug_solver: # pragma: no cover
self.logger.debug("SCC: %s -- %s", scc_id, str(sorted(com)))
for com in comps: for com in comps:
node = com[0] node = com[0]

Loading…
Cancel
Save