git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Cc: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	git@vger.kernel.org
Subject: Re: [PATCH] Correct dir.c to compile on Solaris 9
Date: Sun, 15 Apr 2007 15:48:52 -0700	[thread overview]
Message-ID: <7vbqhp2qzv.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <200704152354.55097.robin.rosenberg.lists@dewire.com> (Robin Rosenberg's message of "Sun, 15 Apr 2007 23:54:53 +0200")

Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:

> The table lookup *is* faster (meastured), but that doesn't make a big difference
> on the total CPU used. The muliple-case-per line thing (both versions, however makes is hard
> to read.  
>
> -- robin
>
> diff --git a/dir.c b/dir.c
> index 7426fde..0780f23 100644
> --- a/dir.c
> +++ b/dir.c
> @@ -423,12 +423,22 @@ static int cmp_name(const void *p1, const void *p2)
>   */
>  static int simple_length(const char *match)
>  {
> -       const char special[256] = {
> -               [0] = 1, ['?'] = 1,
> -               ['\\'] = 1, ['*'] = 1,
> -               ['['] = 1
> -       };
>         int len = -1;
> +       static const char special[256] = {
> +               1,0,0,0,0,0,0,0, /* nul */
> +               0,0,0,0,0,0,0,0,
> +               0,0,0,0,0,0,0,0,
> +               0,0,0,0,0,0,0,0,
> +               0,0,0,0,0,0,0,0,
> +               0,0,1,0,0,0,0,0, /* * */

I wonder if folding this into ctype.c::sane_ctype[] is an
option...

      reply	other threads:[~2007-04-15 22:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-15  4:33 [PATCH] Correct dir.c to compile on Solaris 9 Shawn O. Pearce
2007-04-15 16:25 ` Johannes Schindelin
2007-04-15 21:03   ` Josef Weidendorfer
2007-04-15 21:54     ` Robin Rosenberg
2007-04-15 22:48       ` Junio C Hamano [this message]

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=7vbqhp2qzv.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=Josef.Weidendorfer@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=robin.rosenberg.lists@dewire.com \
    --cc=spearce@spearce.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 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).