From 80602a98bcc3100279e09e1291d47a0adb6addb1 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 30 Dec 2006 19:52:28 +0000 Subject: saw commit of vapier@busybox.net (thanks!), decided to stop doing FOUR memcmp's per each input character. I should have fixed this much earlier... --- scripts/basic/fixdep.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'scripts/basic') diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 2fa78ee6a..65bae4dac 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -225,31 +225,36 @@ void use_config(char *m, int slen) void parse_config_file(char *map, size_t len) { /* modified for bbox */ - char *end = map + len; + char *end_4 = map + len - 4; /* 4 == length of "USE_" */ + char *end_7 = map + len - 7; char *p = map; char *q; int off; - for (; p < end; p++) { - if (p map + len - off) - continue; - for (q = p + off; q < map + len; q++) { + p += off; + for (q = p; q < end_4+4; q++) { if (!(isalnum(*q) || *q == '_')) - goto found; + break; } - continue; - - found: - use_config(p+off, q-p-off); + use_config(p, q-p); } } -- cgit v1.2.3