gdritter repos rust-examples / master
Modify stack-based matcher to use while let Getty Ritter 8 years ago
1 changed file(s) with 1 addition(s) and 4 deletion(s). Collapse all Expand all
1414 * we'll short-circuit out of this loop; otherwise, an empty
1515 * stack means we have failed every possible branch and can
1616 * return false. */
17 while stack.len() > 0 {
18 /* This call to .unwrap() is safe because we've already
19 * manually checked the stack length. */
20 let st = stack.pop().unwrap();
17 while let Some(st) = stack.pop() {
2118 match instrs[st.pc] {
2219 Instr::Char(_) if st.cc >= input.len() =>
2320 continue,