libstd: switch map to use libcore's hash functions.

This commit is contained in:
Erick Tryzelaar 2011-12-26 18:59:50 -08:00
parent 7806180557
commit eade7844a3

View file

@ -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);
}