backtracking: only feedback first slot conflict
authorZac Medico <zmedico@gentoo.org>
Wed, 20 Jun 2012 21:23:47 +0000 (14:23 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 20 Jun 2012 21:23:47 +0000 (14:23 -0700)
Only create BacktrackNode instances for the first conflict which
occurred, since the conflicts that occurred later may have been
caused by the first conflict.

pym/_emerge/resolver/backtracking.py

index 2f8b6d0b6d570645e8cb8117f4e93ee07a44fadb..e3c5c7d78b7d9dd3c8a97ba4d1cc81db8ffa9016 100644 (file)
@@ -132,12 +132,11 @@ class Backtracker(object):
                return True
 
        def _feedback_slot_conflicts(self, conflicts_data):
-               # This should be ordered such that the backtracker will
-               # attempt to solve conflicts which occurred earlier first,
-               # since an earlier conflict can be the cause of a conflict
-               # which occurs later.
-               for slot_data in reversed(conflicts_data):
-                       self._feedback_slot_conflict(slot_data)
+               # Only create BacktrackNode instances for the first
+               # conflict which occurred, since the conflicts that
+               # occurred later may have been caused by the first
+               # conflict.
+               self._feedback_slot_conflict(conflicts_data[0])
 
        def _feedback_slot_conflict(self, conflict_data):
                for pkg, parent_atoms in conflict_data: