Skip to content

Commit

Permalink
Remove redundant index from preference key (#11543)
Browse files Browse the repository at this point in the history
## Summary

We already filter by this on Line 201.
  • Loading branch information
charliermarsh authored Feb 15, 2025
1 parent 985e5be commit 08ad56e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/uv-resolver/src/candidate_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,14 @@ impl CandidateSelector {
// Prefer preferences that match the current environment.
let matches_env = env.included_by_marker(marker.pep508());

// Prefer preferences that match the current index.
let matches_index = index.is_none_or(|index| entry.index().matches(index));

// Prefer the latest (or earliest) version.
let version = if highest {
Either::Left(entry.pin().version())
} else {
Either::Right(std::cmp::Reverse(entry.pin().version()))
};

std::cmp::Reverse((matches_env, matches_index, version))
std::cmp::Reverse((matches_env, version))
});

Either::Right(
Expand Down

0 comments on commit 08ad56e

Please sign in to comment.