git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add help.autocorrect to enable/disable autocorrecting
Date: Wed, 23 Jul 2008 20:00:58 +0100 (BST)	[thread overview]
Message-ID: <alpine.DEB.1.00.0807231958210.8986@racer> (raw)
In-Reply-To: <20080723184443.GD5283@blimp.local>

Hi,

On Wed, 23 Jul 2008, Alex Riesen wrote:

> Johannes Schindelin, Wed, Jul 23, 2008 18:44:49 +0200:
> > > +	n = 1;
> > > +	while (n < main_cmds.cnt &&
> > > +		best_similarity == similarity(main_cmds.names[n]->name))
> > > +		++n;
> > 
> > Mini-nit: you never ask for the value of n, only if it is 1 or larger.  So 
> > you do not need to count...
> 
> But I do, don't I? AFAICS, I use 0, 1 and >1 (this-these).

Yes.  So check cnt > 0 && best_similarity > 5 says if it is 0, and 
cnt > 1 && best_similarity < similarity(...[1]...) says if it is 1.

Ergo: no need to count,
Dscho

  reply	other threads:[~2008-07-23 19:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-22 20:01 [FYI PATCH] git wrapper: DWIM mistyped commands Johannes Schindelin
2008-07-22 20:16 ` [SCNR] " Pierre Habouzit
2008-07-22 20:19   ` Johannes Schindelin
2008-07-22 20:34     ` Pierre Habouzit
2008-07-22 20:37 ` Alex Riesen
2008-07-22 21:03   ` [PATCH] Add help.autocorrect to enable/disable autocorrecting Alex Riesen
2008-07-22 21:08     ` Johannes Schindelin
2008-07-22 21:26       ` Alex Riesen
2008-07-22 21:44         ` Johannes Schindelin
2008-07-22 22:25           ` Alex Riesen
2008-07-23 16:44             ` Johannes Schindelin
2008-07-23 18:44               ` Alex Riesen
2008-07-23 19:00                 ` Johannes Schindelin [this message]
2008-07-23 19:04                   ` Johannes Schindelin
2008-07-22 23:08           ` Junio C Hamano
2008-07-23 16:41             ` [PATCH] Wait help.autocorrect deciseconds before running corrected command Alex Riesen
2008-07-23 16:57               ` Johannes Schindelin
2008-07-23 18:45                 ` Alex Riesen
2008-07-22 23:05 ` [FYI PATCH] git wrapper: DWIM mistyped commands Junio C Hamano
2008-07-22 23:10   ` Sverre Rabbelier
2008-08-28 17:15 [PATCH] Remove calculation of the longest command name from where it is not used Alex Riesen, Alex Riesen
2008-08-28 21:27 ` [PATCH updated] git wrapper: DWIM mistyped commands Alex Riesen
2008-08-28 21:28   ` [PATCH] Add help.autocorrect to enable/disable autocorrecting Alex Riesen
2008-08-29 10:11     ` Andreas Ericsson
2008-09-08  6:50     ` Junio C Hamano
2008-08-30 15:36   ` [PATCH updated] git wrapper: DWIM mistyped commands Junio C Hamano
2008-08-30 16:44     ` Alex Riesen
2008-08-30 17:13       ` [PATCH] Reuse cmdname->len to store pre-calculated similarity indexes Alex Riesen
2008-08-30 17:26         ` Junio C Hamano
2008-08-31 13:50           ` [PATCH] git wrapper: DWIM mistyped commands Alex Riesen
2008-08-31 13:54             ` [PATCH] Add help.autocorrect to enable/disable autocorrecting Alex Riesen
2008-08-31 14:49               ` Matthieu Moy
2008-08-31 16:33                 ` 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=alpine.DEB.1.00.0807231958210.8986@racer \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.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).