Re: [PATCH 8/8] diff: improve positioning of add/delete blocks in diffs
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Aug 13, 2016, 00:09 UTC
- Message-ID
- <2ceda4e1-c927-598b-ee29-598bced21978@alum.mit.edu>
- In-Reply-To
- <CAGZ79kYCwoo6sYefu++KyCdgHfKvRsUp98ZAur+E7E4o_FLtEw@mail.gmail.com>
On 08/04/2016 06:55 PM, Stefan Beller wrote:
Show 10 quoted lines
> [...] > I have just reread the scoring function and I think you could pull out the > `score=indent` assignment (it is always assigned except for indent <0) > > if (indent == -1) > score = 0; > else > score = indent; > ... lots of bonus computation below, which in its current implementation > have lots of "score = indent;" lines as well.
Yes. An earlier version of the heuristic used different indent values in different situations, but that's gone away so the code can be made simpler now. I'll make the change.
Thanks, Michael