Skip to content

Commit

Permalink
add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Eh2406 committed Mar 11, 2024
1 parent 03787f9 commit feb6b55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/internal/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ impl<P: Package, VS: VersionSet, Priority: Ord + Clone> State<P, VS, Priority> {
break;
}
Relation::AlmostSatisfied(package_almost) => {
// Add `package_almost` to the `unit_propagation_buffer` set.
// Putting items in `unit_propagation_buffer` more than once waste cycles,
// but so does checking for duplicates.
// In practice the most common pathology is adding the same package repeatedly.
// So we only check if it is duplicated with the last item.
if self.unit_propagation_buffer.last() != Some(&package_almost) {
self.unit_propagation_buffer.push(package_almost.clone());
}
Expand Down

0 comments on commit feb6b55

Please sign in to comment.