Stefan Beller stefanbel...@googlemail.com 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
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, const void *b) {
+
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
Stefan Beller stefanbel...@googlemail.com writes:
My approach would have been:
sorted_internal_cmds: git.c
{ awk '/cmd_struct commands/,/};/ { if (match($2,//)) print $2 }'
git.c builtin.actual \
sort builtin.actual builtin.expect \
cmp -s builtin.expect builtin.actual
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
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*
On Fri, Jul 26, 2013 at 4:50 PM, Stefan Beller
stefanbel...@googlemail.com 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
7 matches
Mail list logo