Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace [Id.to_int] with [Id.hash] #496

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/automata.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module Ids : sig

val equal : t -> t -> bool
val zero : t
val to_int : t -> int
val hash : t -> int
val pp : t Fmt.t

module Hash_set : sig
Expand All @@ -56,7 +56,7 @@ end = struct

let equal = Int.equal
let zero = 0
let to_int x = x
let hash x = x
let pp = Fmt.int
end

Expand Down Expand Up @@ -348,9 +348,9 @@ module E = struct
let rec hash (t : t) accu =
match t with
| TSeq (_, l, e) ->
hash_combine 0x172a1bce (hash_combine (Id.to_int e.id) (hash_list l accu))
hash_combine 0x172a1bce (hash_combine (Id.hash e.id) (hash_list l accu))
| TExp (marks, e) ->
hash_combine 0x2b4c0d77 (hash_combine (Id.to_int e.id) (Marks.hash marks accu))
hash_combine 0x2b4c0d77 (hash_combine (Id.hash e.id) (Marks.hash marks accu))
| TMatch marks -> hash_combine 0x1c205ad5 (Marks.hash marks accu)

and hash_list =
Expand Down
Loading