Re: [PATCH 09/41] pack-objects: abstract away hash algorithm
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- May 1, 2018, 10:26 UTC
- Message-ID
- <20180501102640.GF15820@duynguyen.home>
- In-Reply-To
- <20180423233951.276447-10-sandals@crustytoothpaste.net>
On Mon, Apr 23, 2018 at 11:39:19PM +0000, brian m. carlson wrote:
Show 6 quoted lines
> @@ -1850,7 +1852,7 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
> /* Now some size filtering heuristics. */
> trg_size = trg_entry->size;
> if (!trg_entry->delta) {
> - max_size = trg_size/2 - 20;
> + max_size = trg_size/2 - the_hash_algo->rawsz;This may be questionable. Note the "heuristics" comment above. I'm not even sure if this is hash size or some magical-yet-randomly-good value. Just wanted to bring the attention for other people with better understand of this code to see
> ref_depth = 1;
> } else {
> max_size = trg_entry->delta_size;