aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp')
-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 b33a7db2..68d518da 100644
--- a/src/comp/util/common.rs
+++ b/src/comp/util/common.rs
@@ -71,6 +71,14 @@ fn new_int_hash[V]() -> std.map.hashmap[int,V] {
ret std.map.mk_hashmap[int,V](hasher, eqer);
}
+fn new_uint_hash[V]() -> std.map.hashmap[uint,V] {
+ fn hash_uint(&uint x) -> uint { ret x; }
+ fn eq_uint(&uint a, &uint b) -> bool { ret a == b; }
+ auto hasher = hash_uint;
+ auto eqer = eq_uint;
+ ret std.map.mk_hashmap[uint,V](hasher, eqer);
+}
+
fn istr(int i) -> str {
ret _int.to_str(i, 10u);
}