aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/alf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/alf.c b/src/alf.c
index 7b27861..8fedb20 100644
--- a/src/alf.c
+++ b/src/alf.c
@@ -206,6 +206,9 @@ int match_token(int pos) {
int i;
for(i = curr_token - 1; i >= INIT_TOKEN; i--) {
+ /* if the first char doesn't match, don't bother with memcmp.
+ this is a 5x speedup (!) */
+ if(input_buf[pos] != *(tokentab[i].start)) continue;
if(memcmp(&input_buf[pos], tokentab[i].start, tokentab[i].length) == 0)
return i;
}