@@ -93,10 +93,10 @@ pub async fn get_statistics_with_limit(
93
93
// counts across all the files in question. If any file does not
94
94
// provide any information or provides an inexact value, we demote
95
95
// the statistic precision to inexact.
96
- num_rows = add_row_stats ( file_stats. num_rows . clone ( ) , num_rows) ;
96
+ num_rows = add_row_stats ( & file_stats. num_rows , & num_rows) ;
97
97
98
98
total_byte_size =
99
- add_row_stats ( file_stats. total_byte_size . clone ( ) , total_byte_size) ;
99
+ add_row_stats ( & file_stats. total_byte_size , & total_byte_size) ;
100
100
101
101
for ( file_col_stats, col_stats) in file_stats
102
102
. column_statistics
@@ -110,8 +110,7 @@ pub async fn get_statistics_with_limit(
110
110
distinct_count : _,
111
111
} = file_col_stats;
112
112
113
- col_stats. null_count =
114
- add_row_stats ( file_nc. clone ( ) , col_stats. null_count . clone ( ) ) ;
113
+ col_stats. null_count = add_row_stats ( file_nc, & col_stats. null_count ) ;
115
114
set_max_if_greater ( file_max, & mut col_stats. max_value ) ;
116
115
set_min_if_lesser ( file_min, & mut col_stats. min_value )
117
116
}
@@ -165,12 +164,12 @@ pub(crate) fn create_max_min_accs(
165
164
}
166
165
167
166
fn add_row_stats (
168
- file_num_rows : Precision < usize > ,
169
- num_rows : Precision < usize > ,
167
+ file_num_rows : & Precision < usize > ,
168
+ num_rows : & Precision < usize > ,
170
169
) -> Precision < usize > {
171
170
match ( file_num_rows, & num_rows) {
172
- ( Precision :: Absent , _) => num_rows. to_inexact ( ) ,
173
- ( lhs, Precision :: Absent ) => lhs. to_inexact ( ) ,
171
+ ( Precision :: Absent , _) => num_rows. clone ( ) . to_inexact ( ) ,
172
+ ( lhs, Precision :: Absent ) => lhs. clone ( ) . to_inexact ( ) ,
174
173
( lhs, rhs) => lhs. add ( rhs) ,
175
174
}
176
175
}
0 commit comments