File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 1ff8994fce4a7ba719bc0b35dceb6442a66888a0
2
+ refs/heads/master: 0fc4403442504dfd05e317f7d34d8935d4c47e0f
Original file line number Diff line number Diff line change @@ -296,15 +296,15 @@ mod chained {
296
296
}
297
297
298
298
obj o<copy K , copy V >( tbl: @t<K , V >,
299
- lf: float ) {
299
+ lf: util :: rational ) {
300
300
fn size ( ) -> uint {
301
301
ret tbl. size ;
302
302
}
303
303
304
304
fn insert ( k : K , v : V ) -> bool {
305
305
let nchains = vec:: len ( tbl. chains ) ;
306
- let load = ( tbl. size + 1 u as float ) / ( nchains as float ) ;
307
- if load > lf {
306
+ let load = { num : tbl. size + 1 u as int , den : nchains as int } ;
307
+ if !util :: rational_leq ( load, lf ) {
308
308
rehash ( * tbl) ;
309
309
}
310
310
ret insert( * tbl, k, v) ;
@@ -349,7 +349,7 @@ mod chained {
349
349
mutable chains: chains ( initial_capacity) ,
350
350
hasher: hasher,
351
351
eqer: eqer} ;
352
- ret o( t, 0.75 ) ;
352
+ ret o( t, { num : 3 , den : 4 } ) ;
353
353
}
354
354
}
355
355
You can’t perform that action at this time.
0 commit comments