Skip to content

Commit

Permalink
perf: remove more redundant scanning
Browse files Browse the repository at this point in the history
Doing the stronger version of pubgrub-rs#175 because it turns out to be important to cargo crates.
  • Loading branch information
Eh2406 committed Aug 22, 2024
1 parent eb528c3 commit ca79234
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/internal/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl<DP: DependencyProvider> State<DP> {
// 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) {
if !self.unit_propagation_buffer.contains(&package_almost) {
self.unit_propagation_buffer.push(package_almost.clone());
}
// Add (not term) to the partial solution with incompat as cause.
Expand Down

0 comments on commit ca79234

Please sign in to comment.