File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,16 @@ pub fn optimize_region_file(
1717 match Region :: from_file_name ( region_file_path) {
1818 Ok ( mut region) => {
1919 let chunks = region. get_chunks ( ) ;
20-
21- let mut chunks_to_delete = Vec :: new ( ) ;
2220 result. total_chunks += chunks. len ( ) ;
2321
22+ let mut chunks_to_delete = Vec :: new ( ) ;
2423 for chunk in chunks {
2524 if chunk. should_delete ( ) {
2625 chunks_to_delete. push ( chunk. clone ( ) ) ;
2726 }
2827 }
28+ result. deleted_chunks += chunks_to_delete. len ( ) ;
29+
2930 for chunk in & chunks_to_delete {
3031 region. remove_chunk ( chunk) ;
3132 }
@@ -38,11 +39,6 @@ pub fn optimize_region_file(
3839 return Ok ( result) ;
3940 }
4041
41- let deleted_chunk_count = chunks_to_delete. len ( ) ;
42- if deleted_chunk_count > 0 {
43- result. deleted_chunks += deleted_chunk_count;
44- }
45-
4642 if write {
4743 let bytes = region. to_bytes ( ) ;
4844 std:: fs:: write ( region_file_path, bytes) ?;
You can’t perform that action at this time.
0 commit comments