wimlib icon indicating copy to clipboard operation
wimlib copied to clipboard

suggestion

Open da0ka opened this issue 1 year ago • 1 comments

I have suggestion for lzx_compress.c. line 2133 should be in line 2128. line 2140 should be removed.

da0ka avatar May 06 '23 23:05 da0ka

--- a/lzx_compress.c	2023-05-06 19:40:22.436861000 -0500
+++ b/lzx_compress.c	2023-05-06 19:42:47.030238982 -0500
@@ -2125,19 +2125,17 @@
 		lzx_compute_match_costs(c);
 		new_queue = lzx_find_min_cost_path(c, block_begin, block_size,
 						   initial_queue, is_16_bit);
-
+		lzx_reset_symbol_frequencies(c);
 		if (--num_passes_remaining == 0)
 			break;
 
 		/* At least one optimization pass remains.  Update the costs. */
-		lzx_reset_symbol_frequencies(c);
 		lzx_tally_item_list(c, block_size, is_16_bit);
 		lzx_build_huffman_codes(c);
 		lzx_set_costs_from_codes(c);
 	}
 
 	/* Done optimizing.  Generate the sequence list and flush the block. */
-	lzx_reset_symbol_frequencies(c);
 	seq_idx = lzx_record_item_list(c, block_size, is_16_bit);
 	lzx_flush_block(c, os, block_begin, block_size, seq_idx);
 	return new_queue;

wdlkmpx avatar May 07 '23 00:05 wdlkmpx