Skip to content

Commit 7806180

Browse files
committed
libcore: add a trivial uint hash function.
1 parent ae225e2 commit 7806180

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libcore/uint.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ pure fn ge(x: uint, y: uint) -> bool { ret x >= y; }
103103
/* Predicate: gt */
104104
pure fn gt(x: uint, y: uint) -> bool { ret x > y; }
105105

106+
/*
107+
Function: hash
108+
109+
Produce a uint suitable for use in a hash table
110+
*/
111+
fn hash(x: uint) -> uint { ret x; }
112+
106113
/*
107114
Function: range
108115

0 commit comments

Comments
 (0)