[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Odd logic for deciding whether to display inline diffs in TMerge

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2007-01-06 13:35:19 CET

Simon Large wrote:
> Hi folks,
>
> I was looking through the TMerge code to try to work out when inline
> diffs are shown and I found this line in BaseView.cpp (line 1289 in r8347)
>
> if ((diffcounts < maxcommon)||
> (smalldiffs==0)||((diffcounts/smalldiffs) > 1))
>
> The last test divides 2 integers and compares with 1, and the previous
> one avoids division by zero. Isn't it easier simply to compare the 2
> integers, or am I missing something subtle?
>
> if ((diffcounts < maxcommon)||(diffcounts > smalldiffs))

Well, of course that would be simpler. But the division was introduced
so i can test with different factors - right now that is one, but I had
it set to two or three previously too.

When I'm satisfied that the '1' we compare the division result against
is good enough, we can change it as you suggested, but right now I leave
it that way so I can test with different values if necessary.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Sat Jan 6 13:35:24 2007

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.