Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ABorgna committed Jul 26, 2022
1 parent 5ee5203 commit a45aaa4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/algo/isomorphism.rs
Expand Up @@ -763,11 +763,6 @@ mod matching {
// number of nodes in graph 1. n! values fit into a 64-bit usize up
// to n = 20, so we don't estimate an upper limit for n > 20.
let n = self.st.0.graph.node_count();
const MAX_N: usize = 20;

if n > MAX_N {
return (0, None);
}

// We hardcode n! values into an array that accounts for architectures
// with smaller usizes to get our upper bound.
Expand Down Expand Up @@ -798,6 +793,10 @@ mod matching {
.map(|n| usize::try_from(*n).ok())
.collect();

if n > upper_bounds.len() {
return (0, None);
}

(0, upper_bounds[n])
}
}
Expand Down

0 comments on commit a45aaa4

Please sign in to comment.