Skip to content

Commit

Permalink
Use smallvec for root causes
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Dec 16, 2024
1 parent d839d70 commit 087bcdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/internal/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ impl<DP: DependencyProvider> State<DP> {
pub(crate) fn unit_propagation(
&mut self,
package: Id<DP::P>,
) -> Result<Vec<(Id<DP::P>, IncompDpId<DP>)>, NoSolutionError<DP>> {
let mut root_causes = Vec::new();
) -> Result<SmallVec<(Id<DP::P>, IncompDpId<DP>)>, NoSolutionError<DP>> {
let mut root_causes = SmallVec::default();
self.unit_propagation_buffer.clear();
self.unit_propagation_buffer.push(package);
while let Some(current_package) = self.unit_propagation_buffer.pop() {
Expand Down

0 comments on commit 087bcdf

Please sign in to comment.