From: Andy Whitcroft <apw@shadowen.org>
To: apodtele <apodtele@gmail.com>
Cc: Nicolas Pitre <nico@cam.org>,
A Large Angry SCM <gitzilla@gmail.com>,
Martin Waitz <tali@admingilde.org>,
git@vger.kernel.org
Subject: Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph
Date: Fri, 13 Oct 2006 14:31:32 +0100 [thread overview]
Message-ID: <452F9534.1030109@shadowen.org> (raw)
In-Reply-To: <d620685f0610130625o2d5f70c5p7cb41f567093df32@mail.gmail.com>
apodtele wrote:
> Hi!
>
> On 10/12/06, Nicolas Pitre <nico@cam.org> wrote:
>> On Thu, 12 Oct 2006, A Large Angry SCM wrote:
>> > Martin Waitz wrote:
>> > > On Thu, Oct 12, 2006 at 03:20:09PM -0700, A Large Angry SCM wrote:
>> > > > > + if (it)
>> > > > > + return it * width / (it + width) + 1;
>> > > > > + else
>> > > > > + return 0;
>> > > > No conditional needed:
>> > > >
>> > > > return it * width / (it + width - 1)
>> > >
>> > > But then it would start scaling much earlier
>> > > (for width 10: at 2 instead of 4).
>> > > This is not bad per se, but different...
>> > >
>> >
>> > OK:
>> > return (it * width + (it + width)/2)) / (it + width - 1)
>> >
>> > Now it's back at 4. ;-)
>>
>> Sure, but at this point the original conditional is probably more
>> efficient.
>>
>
> Don't make me use
> return it * width / (it + width) + !!it;
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
return it * width / (it + width) + (it != 0)
Perhaps?
-apw
next prev parent reply other threads:[~2006-10-13 13:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 19:37 [PATCH 1/2] diff --stat: use asymptotic scaling in graph apodtele
2006-10-12 20:16 ` Martin Waitz
2006-10-12 21:37 ` apodtele
2006-10-12 22:20 ` A Large Angry SCM
2006-10-12 22:27 ` Martin Waitz
2006-10-12 22:48 ` A Large Angry SCM
2006-10-12 22:52 ` Johannes Schindelin
2006-10-12 23:12 ` apodtele
2006-10-13 0:39 ` Nicolas Pitre
2006-10-13 13:25 ` apodtele
2006-10-13 13:31 ` Andy Whitcroft [this message]
2006-10-12 21:53 ` Junio C Hamano
2006-10-12 22:15 ` A Large Angry SCM
2006-10-12 22:24 ` Junio C Hamano
2006-10-13 13:56 ` apodtele
2006-10-14 19:06 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=452F9534.1030109@shadowen.org \
--to=apw@shadowen.org \
--cc=apodtele@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitzilla@gmail.com \
--cc=nico@cam.org \
--cc=tali@admingilde.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.