Skip to content

Commit f58a60f

Browse files
committed
Add method to manually update priorities
1 parent 3d8d9b4 commit f58a60f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/internal/partial_solution.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,25 @@ impl<DP: DependencyProvider> PartialSolution<DP> {
367367
None
368368
}
369369

370+
/// Manually update a package priority that changed independent of the range.
371+
pub fn update_priority(&mut self, package: Id<DP::P>, priority: DP::Priority) {
372+
if self
373+
.package_assignments
374+
.get(&package)
375+
.and_then(|assignment| {
376+
assignment
377+
.assignments_intersection
378+
.potential_package_filter()
379+
})
380+
.is_none()
381+
{
382+
// Only prioritize packages up for decision
383+
return;
384+
}
385+
self.prioritized_potential_packages
386+
.push(package, (priority, Reverse(package.into_raw() as u32)));
387+
}
388+
370389
/// If a partial solution has, for every positive derivation,
371390
/// a corresponding decision that satisfies that assignment,
372391
/// it's a total solution and version solving has succeeded.

0 commit comments

Comments
 (0)