File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: dec92d392e59075ceee750b4b816a84c873a5212
2
+ refs/heads/master: 6a60cb1e0cf4bdc37e78c0560e6fed0743a9c271
Original file line number Diff line number Diff line change @@ -50,16 +50,15 @@ fn def_eq(&ast.def_id a, &ast.def_id b) -> bool {
50
50
ret a. _0 == b. _0 && a. _1 == b. _1 ;
51
51
}
52
52
53
- fn new_def_hash[ V ] ( ) -> std. map . hashmap [ ast. def_id , V ] {
54
-
55
- fn hash ( & ast. def_id d ) -> uint {
56
- let uint u = d. _0 as uint ;
57
- u <<= 16 u;
58
- u |= d. _1 as uint ;
59
- ret u;
60
- }
53
+ fn hash_def ( & ast. def_id d ) -> uint {
54
+ auto h = 5381 u;
55
+ h = ( ( h << 5 u) + h) ^ ( d. _0 as uint ) ;
56
+ h = ( ( h << 5 u) + h) ^ ( d. _1 as uint ) ;
57
+ ret h;
58
+ }
61
59
62
- let std. map. hashfn[ ast. def_id ] hasher = hash;
60
+ fn new_def_hash[ V ] ( ) -> std. map . hashmap [ ast. def_id , V ] {
61
+ let std. map . hashfn [ ast. def_id ] hasher = hash_def;
63
62
let std. map. eqfn[ ast. def_id ] eqer = def_eq;
64
63
ret std. map . mk_hashmap [ ast. def_id , V ] ( hasher, eqer) ;
65
64
}
You can’t perform that action at this time.
0 commit comments