Skip to content

Commit eade784

Browse files
committed
libstd: switch map to use libcore's hash functions.
1 parent 7806180 commit eade784

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ Function: new_int_hash
384384
Construct a hashmap for int keys
385385
*/
386386
fn new_int_hash<V: copy>() -> hashmap<int, V> {
387-
fn hash_int(&&x: int) -> uint { ret x as uint; }
387+
fn hash_int(&&x: int) -> uint { int::hash(x) }
388388
fn eq_int(&&a: int, &&b: int) -> bool { ret a == b; }
389389
ret mk_hashmap(hash_int, eq_int);
390390
}
@@ -395,7 +395,7 @@ Function: new_uint_hash
395395
Construct a hashmap for uint keys
396396
*/
397397
fn new_uint_hash<V: copy>() -> hashmap<uint, V> {
398-
fn hash_uint(&&x: uint) -> uint { ret x; }
398+
fn hash_uint(&&x: uint) -> uint { uint::hash(x) }
399399
fn eq_uint(&&a: uint, &&b: uint) -> bool { ret a == b; }
400400
ret mk_hashmap(hash_uint, eq_uint);
401401
}

0 commit comments

Comments
 (0)