Skip to content

Commit

Permalink
refactor: simplify delta_alt with fold
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrinberg committed Oct 5, 2024
1 parent e69f5f7 commit d9906b4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/automata.ml
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,7 @@ and delta_rep ctx marks x rep_kind kind y rem =
| `Greedy -> Desc.tseq kind y x (Desc.add_match rem marks')
| `Non_greedy -> Desc.add_match (Desc.tseq kind y x rem) marks

and delta_alt ctx marks l rem =
match l with
| [] -> rem
| y :: r -> delta_expr ctx marks y (delta_alt ctx marks r rem)
and delta_alt ctx marks l rem = List.fold_right l ~init:rem ~f:(delta_expr ctx marks)

and delta_seq ctx (kind : Sem.t) y z rem =
match Desc.first_match y with
Expand Down

0 comments on commit d9906b4

Please sign in to comment.