From eade7844a339557e57b2ba0503d8edf19ff60f43 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Mon, 26 Dec 2011 18:59:50 -0800 Subject: [PATCH] libstd: switch map to use libcore's hash functions. --- src/libstd/map.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/map.rs b/src/libstd/map.rs index db47160216c..53e59e210f8 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -384,7 +384,7 @@ fn new_str_hash() -> hashmap { Construct a hashmap for int keys */ fn new_int_hash() -> hashmap { - 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 @@ fn new_int_hash() -> hashmap { Construct a hashmap for uint keys */ fn new_uint_hash() -> hashmap { - 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); } -- 2.44.0