getdata: new xstrstr function for performance

The strstr is changed to xstrstr, which short cuts to points in
string where first differences are expected to found. This made
the tool tiny bit quicker.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-07-11 00:08:45 +02:00
parent 8c6a3d9a4a
commit b1cd84e804
3 changed files with 32 additions and 5 deletions

View file

@ -162,6 +162,7 @@ void *safe_malloc(const size_t size)
;
void *safe_realloc(void *ptr, const size_t size);
char *safe_strdup(const char *str) __attribute__ ((nonnull(1)));
int xstrstr(char *a, char *b, int len);
void print_version(void) __attribute__ ((noreturn));
void usage(int status) __attribute__ ((noreturn));
/* qsort required functions... */