git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Speedup scanning for excluded files.

From
Pierre Habouzit <madcoder@debian.org>
Date
Oct 29, 2007, 08:02 UTC
Message-ID
<20071029080234.GA22826@artemis.corp>
In-Reply-To
<200710290845.26727.lars@trolltech.com>
On Mon, Oct 29, 2007 at 07:45:26AM +0000, Lars Knoll wrote:
> +static int no_wildcard(const char *string)
> +{
> +    return !strchr(string, '*') && !strchr(string, '?') 
> && !strchr(string, '[') && !strchr(string, '{');
       return string[strcspn(string, "*?[{")] == '\0';

is faster as it doesn't scan the string 4 time in the case where there is no wildcard.

Show 8 quoted lines
> +}
> +
>  void add_exclude(const char *string, const char *base,
>  		 int baselen, struct exclude_list *which)
>  {
>  	struct exclude *x = xmalloc(sizeof (*x));
>  
> +        x->to_exclude = 1;
  You used spaces in here, and in many places of your patch.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Lars KnollNext: Lars Knoll
Message 2 of 8 in “Speedup scanning for excluded files.”
  1. Speedup scanning for excluded files.Lars Knoll, Oct 29, 2007
  2. Pierre HabouzitOct 29, 2007
  3. Lars KnollOct 29, 2007
  4. Junio C HamanoOct 29, 2007
  5. Morten WelinderOct 29, 2007
  6. Junio C HamanoOct 30, 2007
  7. Lars KnollOct 30, 2007
  8. Speedup scanning for excluded files.Lars Knoll, Oct 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.