Stefan Beller writes:
> However I could not find a speedup.
> So if the patch is accepted, it would only be for readability.
This adds a maintenance burden. It is very easy for somebody to
mistakenly run "sort" on the region in her editor under non C
locale.
Perhaps with a change like the atta
On Sat, Jul 27, 2013 at 4:49 AM, Stefan Beller
wrote:
> I was fiddling around with make now to include the suggestion of Eric to
> check the arguments for being sorted in make. However I do not
> seem to fully understand the syntax yet.
> My approach would have been:
>
> sorted_internal_cmds: git.
Stefan Beller writes:
> My approach would have been:
>
> sorted_internal_cmds: git.c
> { awk '/cmd_struct commands/,/};/ { if (match($2,/"/)) print $2 }'
> builtin.actual && \
> sort builtin.expect && \
> cmp -s builtin.expect builtin.actual && \
> rm builtin.expect built
There are currently 115 commands built into the git executable.
Before this commit, it was iterated over these commands in a linear
order, i.e. each command was checked.
As it turns out the commands are already sorted alphabetically, it is easy
to perform a binary search instead of linear searchin
On 07/26/2013 10:57 PM, Jonathan Nieder wrote:
> Hi,
>
> Stefan Beller wrote:
>
>> --- a/git.c
>> +++ b/git.c
>> @@ -309,9 +309,18 @@ static int run_builtin(struct cmd_struct *p, int argc,
>> const char **argv)
>> return 0;
>> }
>>
>> +static int compare_internal_command(const void *a, c
On Fri, Jul 26, 2013 at 4:50 PM, Stefan Beller
wrote:
> There are currently 115 commands built into the git executable.
> Before this commit, it was iterated over these commands in a linear
> order, i.e. each command was checked.
>
> As it turns out the commands are already sorted alphabetically,
Hi,
Stefan Beller wrote:
> --- a/git.c
> +++ b/git.c
> @@ -309,9 +309,18 @@ static int run_builtin(struct cmd_struct *p, int argc,
> const char **argv)
> return 0;
> }
>
> +static int compare_internal_command(const void *a, const void *b) {
> + /* The first parameter is of type char
There are currently 115 commands built into the git executable.
Before this commit, it was iterated over these commands in a linear
order, i.e. each command was checked.
As it turns out the commands are already sorted alphabetically, it is easy
to perform a binary search instead of linear searchin
8 matches
Mail list logo