Skip to content

Commit

Permalink
clip
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Feb 29, 2024
1 parent ea97899 commit 431a0df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data/src/dim/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ use TDim::*;

fn tdim_compare(a: &TDim, b: &TDim) -> Ordering {
match (a, b) {
(Sym(a), Sym(b)) => a.cmp(&b),
(Val(a), Val(b)) => a.cmp(&b),
(Sym(a), Sym(b)) => a.cmp(b),
(Val(a), Val(b)) => a.cmp(b),
(Add(a), Add(b)) | (Mul(a), Mul(b)) => a.len().cmp(&b.len()).then(
a.iter()
.zip(b.iter())
.fold(Ordering::Equal, |acc, (a, b)| acc.then_with(|| tdim_compare(a, b))),
),
(MulInt(p, d), MulInt(q, e)) => p.cmp(&q).then_with(|| tdim_compare(d, e)),
(Div(d, p), Div(e, q)) => p.cmp(&q).then_with(|| tdim_compare(d, e)),
(MulInt(p, d), MulInt(q, e)) => p.cmp(q).then_with(|| tdim_compare(d, e)),
(Div(d, p), Div(e, q)) => p.cmp(q).then_with(|| tdim_compare(d, e)),
(Sym(_), _) => Ordering::Less,
(_, Sym(_)) => Ordering::Greater,
(Val(_), _) => Ordering::Less,
Expand Down

0 comments on commit 431a0df

Please sign in to comment.