@@ -90,15 +90,13 @@ pub mod chained {
90
90
}
91
91
Some ( e1) => {
92
92
comp += 1 u;
93
- unsafe {
94
- if e1. hash == h && e1. key == * k {
95
- debug ! ( "search_tbl: present, comp %u, \
96
- hash %u, idx %u",
97
- comp, h, idx) ;
98
- return FoundAfter ( e0, e1) ;
99
- } else {
100
- e0 = e1;
101
- }
93
+ if e1. hash == h && e1. key == * k {
94
+ debug ! (
95
+ "search_tbl: present, comp %u, hash %u, idx %u" ,
96
+ comp, h, idx) ;
97
+ return FoundAfter ( e0, e1) ;
98
+ } else {
99
+ e0 = e1;
102
100
}
103
101
}
104
102
}
@@ -114,14 +112,12 @@ pub mod chained {
114
112
return NotFound ;
115
113
}
116
114
Some ( e) => {
117
- unsafe {
118
- if e. hash == h && e. key == * k {
119
- debug ! ( "search_tbl: present, comp %u, hash %u, \
120
- idx %u", 1 u, h, idx) ;
121
- return FoundFirst ( idx, e) ;
122
- } else {
123
- return self . search_rem ( k, h, idx, e) ;
124
- }
115
+ if e. hash == h && e. key == * k {
116
+ debug ! ( "search_tbl: present, comp %u, hash %u, \
117
+ idx %u", 1 u, h, idx) ;
118
+ return FoundFirst ( idx, e) ;
119
+ } else {
120
+ return self . search_rem ( k, h, idx, e) ;
125
121
}
126
122
}
127
123
}
@@ -258,12 +254,10 @@ pub mod chained {
258
254
259
255
impl < K : Eq IterBytes Hash Copy , V : Copy > T < K , V > {
260
256
pure fn find ( & self , k : & K ) -> Option < V > {
261
- unsafe {
262
- match self . search_tbl ( k, k. hash_keyed ( 0 , 0 ) as uint ) {
263
- NotFound => None ,
264
- FoundFirst ( _, entry) => Some ( entry. value ) ,
265
- FoundAfter ( _, entry) => Some ( entry. value )
266
- }
257
+ match self . search_tbl ( k, k. hash_keyed ( 0 , 0 ) as uint ) {
258
+ NotFound => None ,
259
+ FoundFirst ( _, entry) => Some ( entry. value ) ,
260
+ FoundAfter ( _, entry) => Some ( entry. value )
267
261
}
268
262
}
269
263
@@ -364,9 +358,7 @@ pub mod chained {
364
358
365
359
impl < K : Eq IterBytes Hash Copy , V : Copy > T < K , V > : ops:: Index < K , V > {
366
360
pure fn index ( & self , k : K ) -> V {
367
- unsafe {
368
- self . get ( & k)
369
- }
361
+ self . get ( & k)
370
362
}
371
363
}
372
364
0 commit comments