aboutsummaryrefslogtreecommitdiff
path: root/src/comp/util/common.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp/util/common.rs')
-rw-r--r--src/comp/util/common.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/comp/util/common.rs b/src/comp/util/common.rs
index 4b4f5481..b23d6a1e 100644
--- a/src/comp/util/common.rs
+++ b/src/comp/util/common.rs
@@ -64,6 +64,14 @@ fn new_def_hash[V]() -> std.map.hashmap[ast.def_id,V] {
ret std.map.mk_hashmap[ast.def_id,V](hasher, eqer);
}
+fn new_int_hash[V]() -> std.map.hashmap[int,V] {
+ fn hash_int(&int x) -> uint { ret x as uint; }
+ fn eq_int(&int a, &int b) -> bool { ret a == b; }
+ auto hasher = hash_int;
+ auto eqer = eq_int;
+ ret std.map.mk_hashmap[int,V](hasher, eqer);
+}
+
fn istr(int i) -> str {
ret _int.to_str(i, 10u);
}