summaryrefslogtreecommitdiffstats
path: root/src/ui.c
diff options
context:
space:
mode:
authorHolger Eitzenberger <holger@eitzenberger.org>2011-02-01 18:13:10 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-02-01 18:13:10 +0100
commitff1939dd4f7e1ccb2e98e2a17d8d2b8088fc2ac6 (patch)
tree2c55402ba1a20474a2f33b36b2d8a11ec5c62497 /src/ui.c
parent004f06f32dd28f225a00d3ba7648a29eab28132e (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 'src/ui.c')
0 files changed, 0 insertions, 0 deletions