File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -602,15 +602,11 @@ impl HistoricalMinMaxBuckets<'_> {
602
602
let required_decays = now. duration_since ( last_updated) . as_secs ( )
603
603
. checked_div ( half_life. as_secs ( ) )
604
604
. map_or ( u32:: max_value ( ) , |decays| cmp:: min ( decays, u32:: max_value ( ) as u64 ) as u32 ) ;
605
- let mut min_buckets = [ 0 ; 8 ] ;
606
- for ( idx, bucket) in self . min_liquidity_offset_history . buckets . iter ( ) . enumerate ( ) {
607
- min_buckets[ idx] = ( * bucket) . checked_shr ( required_decays) . unwrap_or ( 0 ) ;
608
- }
609
- let mut max_buckets = [ 0 ; 8 ] ;
610
- for ( idx, bucket) in self . max_liquidity_offset_history . buckets . iter ( ) . enumerate ( ) {
611
- max_buckets[ idx] = ( * bucket) . checked_shr ( required_decays) . unwrap_or ( 0 ) ;
612
- }
613
- ( min_buckets, max_buckets, required_decays)
605
+ let mut min_buckets = * self . min_liquidity_offset_history ;
606
+ min_buckets. time_decay_data ( required_decays) ;
607
+ let mut max_buckets = * self . max_liquidity_offset_history ;
608
+ max_buckets. time_decay_data ( required_decays) ;
609
+ ( min_buckets. buckets , max_buckets. buckets , required_decays)
614
610
}
615
611
616
612
#[ inline]
You can’t perform that action at this time.
0 commit comments