diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2011-02-01 18:13:10 +0100 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-02-01 18:13:10 +0100 |
commit | ff1939dd4f7e1ccb2e98e2a17d8d2b8088fc2ac6 (patch) | |
tree | 2c55402ba1a20474a2f33b36b2d8a11ec5c62497 /m4 | |
parent | 004f06f32dd28f225a00d3ba7648a29eab28132e (diff) |
ipset: improve command argument parsing
The number of comparisons for a matching a command name can be
made smaller by just checking on argv[1].
As an example consider the following 'create' arguments 'hashsize',
'family' and 'timeout'. When having the command
create foo hash:ip timeout 60 family inet hashsize 64
it compares without this patch:
strcmp("timeout", "hashsize")
strcmp("64", "hashsize")
strcmp("family", "hashsize")
strcmp("inet", "hashsize")
strcmp("hashsize", "hashsize")
It is worse in practice, as 'create' has more arguments than this.
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Diffstat (limited to 'm4')
0 files changed, 0 insertions, 0 deletions