aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/closure.ml
diff options
context:
space:
mode:
authorGravatar ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-10-24 17:28:00 +0000
committerGravatar ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-10-24 17:28:00 +0000
commit9e37e3b9695a214040c52082b1e7288df9362b33 (patch)
treebc2bc853f3a01999ac4b07b847e43e747e6f104d /kernel/closure.ml
parent748d4e285c9352b5678e07963a295341cc6acc5b (diff)
Specializing hash functions for widely used types.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16933 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel/closure.ml')
-rw-r--r--kernel/closure.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/closure.ml b/kernel/closure.ml
index a32be4f69..98fb467c8 100644
--- a/kernel/closure.ml
+++ b/kernel/closure.ml
@@ -213,7 +213,11 @@ module IdKeyHash =
struct
type t = id_key
let equal = Names.eq_id_key
- let hash = Hashtbl.hash
+ open Hashset.Combine
+ let hash = function
+ | ConstKey c -> combinesmall 1 (Constant.hash c)
+ | VarKey id -> combinesmall 2 (Id.hash id)
+ | RelKey i -> combinesmall 3 (Int.hash i)
end
module KeyTable = Hashtbl.Make(IdKeyHash)