Skip to content

Commit cd4bce0

Browse files
committed
---
yaml --- r: 2062 b: refs/heads/master c: 9d9790c h: refs/heads/master v: v3
1 parent dcb08e0 commit cd4bce0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: e0faf573132e4b0c8d38087f0224ca968edbe2e9
2+
refs/heads/master: 9d9790c7f50b2bc2076a821974ed31e99bac9ef2

trunk/src/comp/util/common.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ fn new_int_hash[V]() -> std.map.hashmap[int,V] {
7171
ret std.map.mk_hashmap[int,V](hasher, eqer);
7272
}
7373

74+
fn new_uint_hash[V]() -> std.map.hashmap[uint,V] {
75+
fn hash_uint(&uint x) -> uint { ret x; }
76+
fn eq_uint(&uint a, &uint b) -> bool { ret a == b; }
77+
auto hasher = hash_uint;
78+
auto eqer = eq_uint;
79+
ret std.map.mk_hashmap[uint,V](hasher, eqer);
80+
}
81+
7482
fn istr(int i) -> str {
7583
ret _int.to_str(i, 10u);
7684
}

0 commit comments

Comments
 (0)