git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: fork0@t-online.de (Alex Riesen)
To: David Rientjes <rientjes@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] remove inline iteration variable
Date: Wed, 16 Aug 2006 22:10:19 +0200	[thread overview]
Message-ID: <20060816201019.GA6083@steel.home> (raw)
In-Reply-To: <Pine.LNX.4.63.0608161011100.20470@chino.corp.google.com>

David Rientjes, Wed, Aug 16, 2006 19:14:44 +0200:
> > > Remove unnecessary iteration variable in inline.
> > > -       for (i = 0; i < in; i++) putchar(' ');
> > > +       for (; in > 0; in--)
> > 
> > while(in--) putchar(' ');
> > 
> 
> That goes into an infinite loop if the argument is negative because
> it emits a cmpl $0, x(%ebp).  Should never happen, but there's no
> reason not to prevent it with a for loop.

while (in-- > 0) putchar(' ');

still shorter :)

  reply	other threads:[~2006-08-16 20:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-15 17:23 [PATCH] remove inline iteration variable David Rientjes
2006-08-16  7:27 ` Alex Riesen
2006-08-16 17:14   ` David Rientjes
2006-08-16 20:10     ` Alex Riesen [this message]
2006-08-16 20:16       ` Junio C Hamano
2006-08-16 21:41       ` David Rientjes
2006-08-17  9:11         ` Alex Riesen

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=20060816201019.GA6083@steel.home \
    --to=fork0@t-online.de \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    --cc=rientjes@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).