diff options
| author | Brian Anderson <[email protected]> | 2011-03-13 19:40:25 -0400 |
|---|---|---|
| committer | Brian Anderson <[email protected]> | 2011-03-13 19:40:25 -0400 |
| commit | bbb6836da003be71744b6e6ea7af1fd4674f8291 (patch) | |
| tree | fc7780f767666cced8406818806216bee3863c91 /src/comp/util/common.rs | |
| parent | Remove extra blocks from the translation of expr_block (diff) | |
| parent | Add llvmext/include to the list of include directories to hopefully put out t... (diff) | |
| download | rust-bbb6836da003be71744b6e6ea7af1fd4674f8291.tar.xz rust-bbb6836da003be71744b6e6ea7af1fd4674f8291.zip | |
Merge branch 'master' into recursive-elseif
Conflicts:
src/comp/middle/typeck.rs
Diffstat (limited to 'src/comp/util/common.rs')
| -rw-r--r-- | src/comp/util/common.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/comp/util/common.rs b/src/comp/util/common.rs index 071acea2..63ec2c69 100644 --- a/src/comp/util/common.rs +++ b/src/comp/util/common.rs @@ -46,6 +46,10 @@ fn new_str_hash[V]() -> std.map.hashmap[str,V] { ret std.map.mk_hashmap[str,V](hasher, eqer); } +fn def_eq(&ast.def_id a, &ast.def_id b) -> bool { + ret a._0 == b._0 && a._1 == b._1; +} + fn new_def_hash[V]() -> std.map.hashmap[ast.def_id,V] { fn hash(&ast.def_id d) -> uint { @@ -55,12 +59,8 @@ fn new_def_hash[V]() -> std.map.hashmap[ast.def_id,V] { ret u; } - fn eq(&ast.def_id a, &ast.def_id b) -> bool { - ret a._0 == b._0 && a._1 == b._1; - } - let std.map.hashfn[ast.def_id] hasher = hash; - let std.map.eqfn[ast.def_id] eqer = eq; + let std.map.eqfn[ast.def_id] eqer = def_eq; ret std.map.mk_hashmap[ast.def_id,V](hasher, eqer); } |