Skip to content

Commit

Permalink
clarify depth-first traversal in collect_dnf
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev committed Aug 9, 2024
1 parent efd0fd7 commit 1d7fc07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/pep508-rs/src/marker/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ pub(crate) fn to_dnf(tree: &MarkerTree) -> Vec<Vec<MarkerExpression>> {

/// Walk a [`MarkerTree`] recursively and construct a DNF expression.
///
/// A decision diagram can be converted to DNF form by walking the tree and collecting
/// all paths to a `true` terminal node.
/// A decision diagram can be converted to DNF form by performing a depth-first traversal of
/// the tree and collecting all paths to a `true` terminal node.
///
/// `path` is the list of marker expressions traversed on the current path.
fn collect_dnf(
tree: &MarkerTree,
dnf: &mut Vec<Vec<MarkerExpression>>,
Expand Down

0 comments on commit 1d7fc07

Please sign in to comment.