fix(generate): assert there is a Nfa last state before retrieving it
Prevents unsigned subtraction wrapping antics in release builds
This commit is contained in:
parent
c54bc441ba
commit
31ff62445b
1 changed files with 1 additions and 0 deletions
|
|
@ -434,6 +434,7 @@ impl Nfa {
|
|||
}
|
||||
|
||||
pub fn last_state_id(&self) -> u32 {
|
||||
assert!(!self.states.is_empty());
|
||||
self.states.len() as u32 - 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue