File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -479,6 +479,7 @@ where
479479 R : Rng + ?Sized ,
480480{
481481 let mut min_block_size = 0 ;
482+ let mut max_valid_block_size = 0 ;
482483 let mut rejectset = RejectSet :: new ( ( max_block_size * 4 ) . min ( 1 ) ) ;
483484
484485 info ! (
@@ -514,7 +515,11 @@ where
514515 match construct_block ( & mut rng, serializer, block_size) {
515516 Ok ( block) => {
516517 block_sizes_used += 1 ;
517- bytes_remaining = bytes_remaining. saturating_sub ( block. total_bytes . get ( ) ) ;
518+ let total_bytes = block. total_bytes . get ( ) ;
519+ if total_bytes > max_valid_block_size {
520+ max_valid_block_size = total_bytes;
521+ }
522+ bytes_remaining = bytes_remaining. saturating_sub ( total_bytes) ;
518523 block_cache. push ( block) ;
519524 }
520525 Err ( SpinError :: EmptyBlock ) => {
@@ -579,8 +584,11 @@ where
579584 let min_block_str = Byte :: from_u64 ( min_block_size. into ( ) )
580585 . get_appropriate_unit ( byte_unit:: UnitType :: Binary )
581586 . to_string ( ) ;
587+ let max_valid_block_str = Byte :: from_u64 ( max_valid_block_size. into ( ) )
588+ . get_appropriate_unit ( byte_unit:: UnitType :: Binary )
589+ . to_string ( ) ;
582590 info ! (
583- "Filled {filled_sum_str} of requested {capacity_sum_str}. Discovered minimum block size of {min_block_str}"
591+ "Filled {filled_sum_str} of requested {capacity_sum_str}. Discovered minimum block size of {min_block_str}, maximum valid {max_valid_block_str} "
584592 ) ;
585593
586594 Ok ( block_cache)
You can’t perform that action at this time.
0 commit comments