File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1134,7 +1134,7 @@ impl HistoricalData {
11341134 fn quartiles ( & self ) -> ( f64 , f64 ) {
11351135 let pcs = self . percent_changes ( ) ;
11361136 fn median ( data : & [ f64 ] ) -> f64 {
1137- if data. len ( ) % 2 == 0 {
1137+ if data. len ( ) . is_multiple_of ( 2 ) {
11381138 ( data[ ( data. len ( ) - 1 ) / 2 ] + data[ data. len ( ) / 2 ] ) / 2.0
11391139 } else {
11401140 data[ data. len ( ) / 2 ]
@@ -1144,7 +1144,7 @@ impl HistoricalData {
11441144 let len = pcs. len ( ) ;
11451145 let ( h1_end, h2_begin) = if len <= 2 {
11461146 ( 0 , std:: cmp:: min ( len, 1 ) )
1147- } else if len % 2 == 0 {
1147+ } else if len. is_multiple_of ( 2 ) {
11481148 ( len / 2 - 2 , len / 2 + 1 )
11491149 } else {
11501150 ( len / 2 - 1 , len / 2 + 1 )
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use database::{
1111 Target ,
1212} ;
1313use parking_lot:: RwLock ;
14- use std:: { str :: FromStr , sync:: Arc } ;
14+ use std:: sync:: Arc ;
1515use tokio:: time:: { self , Duration , MissedTickBehavior } ;
1616
1717pub fn is_job_queue_enabled ( ) -> bool {
You can’t perform that action at this time.
0 commit comments