Minor optimisation of grep.c