Skip to content

Commit

Permalink
fix next_required_pos calculation, add release profile
Browse files Browse the repository at this point in the history
  • Loading branch information
bminixhofer committed Jan 14, 2021
1 parent af53af1 commit 0e3f8e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
members = [
"nlprule",
"bindings/python"
]
]

[profile.release]
lto = "fat"
codegen-units = 1
5 changes: 4 additions & 1 deletion nlprule/src/rule/engine/composition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,10 @@ impl Composition {
return false;
}

let next_required_pos = match self.can_stop_mask[index + 1..].iter().position(|x| !x) {
let next_required_pos = match self.parts[index + 1..]
.iter()
.position(|x| x.quantifier.min > 0)
{
Some(pos) => index + 1 + pos + 1,
None => self.parts.len(),
};
Expand Down

0 comments on commit 0e3f8e8

Please sign in to comment.