Skip to content

Commit

Permalink
refactor: move inline marks_set_idx helper
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: 8ab11801-f4c9-4375-9702-1ccba4fefef4 -->
  • Loading branch information
rgrinberg committed Apr 16, 2024
1 parent a819737 commit 0738c55
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/automata.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,12 @@ module Marks = struct
let hash m accu =
hash_marks_offset m.marks (hash_combine (Hashtbl.hash m.pmarks) accu)

let rec marks_set_idx idx = function
| (a, -1) :: rem ->
(a, idx) :: marks_set_idx idx rem
| marks ->
marks

let marks_set_idx marks idx =
{ marks with marks = marks_set_idx idx marks.marks }
let marks_set_idx =
let rec marks_set_idx idx = function
| (a, -1) :: rem -> (a, idx) :: marks_set_idx idx rem
| marks -> marks
in
fun marks idx -> { marks with marks = marks_set_idx idx marks.marks }

let pp_marks ch t =
match t.marks with
Expand Down

0 comments on commit 0738c55

Please sign in to comment.