Skip to content

Commit

Permalink
Rename prioritize into pick_highest_priority_pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
mpizenberg authored and Eh2406 committed Oct 2, 2023
1 parent 4d8da24 commit a00c3a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/internal/partial_solution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ impl<P: Package, VS: VersionSet, Priority: Ord + Clone> PartialSolution<P, VS, P
}
}

pub fn prioritize(&mut self, prioritizer: impl Fn(&P, &VS) -> Priority) -> Option<P> {
pub fn pick_highest_priority_pkg(
&mut self,
prioritizer: impl Fn(&P, &VS) -> Priority,
) -> Option<P> {
let check_all = self.changed_this_decision_level
== self.current_decision_level.0.saturating_sub(1) as usize;
let current_decision_level = self.current_decision_level;
Expand Down
6 changes: 3 additions & 3 deletions src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ pub fn resolve<P: Package, VS: VersionSet>(
state.partial_solution
);

let Some(potential_packages) = state
let Some(highest_priority_pkg) = state
.partial_solution
.prioritize(|p, r| dependency_provider.prioritize(p, r))
.pick_highest_priority_pkg(|p, r| dependency_provider.prioritize(p, r))
else {
return Ok(state.partial_solution.extract_solution());
};
next = potential_packages;
next = highest_priority_pkg;

let term_intersection = state
.partial_solution
Expand Down

0 comments on commit a00c3a6

Please sign in to comment.