From 639bca2a58e872238e991311676f448065093ea2 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Fri, 10 Oct 2014 20:03:17 +0100 Subject: Simplify _resolve_system_artifacts --- morphlib/artifactresolver.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/morphlib/artifactresolver.py b/morphlib/artifactresolver.py index 30fb5e5a..e53c7511 100644 --- a/morphlib/artifactresolver.py +++ b/morphlib/artifactresolver.py @@ -57,19 +57,11 @@ class ArtifactResolver(object): if not a.dependents] def _resolve_system_artifacts(self, source, artifacts): # pragma: no cover - systems = [source.artifacts[name] - for name in source.split_rules.artifacts] + systems = [source.artifacts[name] for name + in source.split_rules.artifacts] - for system in (s for s in systems if s not in self._added_artifacts): - artifacts.append(system) - self._added_artifacts.add(system) - - resolved_artifacts = self._resolve_system_dependencies(systems, source) - - for artifact in resolved_artifacts: - if not artifact in self._added_artifacts: - artifacts.append(artifact) - self._added_artifacts.add(artifact) + artifacts += systems + artifacts += self._resolve_system_dependencies(systems, source) def _resolve_stratum_artifacts(self, source, artifacts): # Iterate split_rules.artifacts, rather than -- cgit v1.2.1