libstd: switch map to use libcore's hash functions.
This commit is contained in:
parent
7806180557
commit
eade7844a3
1 changed files with 2 additions and 2 deletions
|
|
@ -384,7 +384,7 @@ Function: new_int_hash
|
|||
Construct a hashmap for int keys
|
||||
*/
|
||||
fn new_int_hash<V: copy>() -> hashmap<int, V> {
|
||||
fn hash_int(&&x: int) -> uint { ret x as uint; }
|
||||
fn hash_int(&&x: int) -> uint { int::hash(x) }
|
||||
fn eq_int(&&a: int, &&b: int) -> bool { ret a == b; }
|
||||
ret mk_hashmap(hash_int, eq_int);
|
||||
}
|
||||
|
|
@ -395,7 +395,7 @@ Function: new_uint_hash
|
|||
Construct a hashmap for uint keys
|
||||
*/
|
||||
fn new_uint_hash<V: copy>() -> hashmap<uint, V> {
|
||||
fn hash_uint(&&x: uint) -> uint { ret x; }
|
||||
fn hash_uint(&&x: uint) -> uint { uint::hash(x) }
|
||||
fn eq_uint(&&a: uint, &&b: uint) -> bool { ret a == b; }
|
||||
ret mk_hashmap(hash_uint, eq_uint);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue