Skip to content

Instantly share code, notes, and snippets.

@sinya8282
Created February 18, 2011 20:03
Show Gist options
  • Save sinya8282/834304 to your computer and use it in GitHub Desktop.
Save sinya8282/834304 to your computer and use it in GitHub Desktop.
why latter is fast ? (reject called from main loop continuously)
void
reject(UCHARP beg, UCHARP buf, UCHARP end, ENVP env){
if (buf >= end) {
if (env->print_count) {
if (env->filename) {
printf("%s:", env->filename);
}
printf("%d\n", env->count);
}
return;
}
beg = buf;
return s0(beg, buf, end, env);
}
/* remove if-statement ver. */
void
reject(UCHARP beg, UCHARP buf, UCHARP end, ENVP env){
if (buf >= end) {
return;
}
beg = buf;
return s0(beg, buf, end, env);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment