From: Dale Weiler Date: Sun, 6 Jan 2013 03:34:56 +0000 (+0000) Subject: Use memcmp with strlen for correct_exists (it's a hell of a lot faster) X-Git-Tag: before-library~363^2~16 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=106db76b9de624e6f26f16aa3e81ce94ec2c03ef Use memcmp with strlen for correct_exists (it's a hell of a lot faster) --- diff --git a/correct.c b/correct.c index 3926441..407d06a 100644 --- a/correct.c +++ b/correct.c @@ -399,7 +399,7 @@ static char **correct_edit(const char *ident) { static int correct_exist(char **array, size_t rows, char *ident) { size_t itr; for (itr = 0; itr < rows; itr++) - if (!strcmp(array[itr], ident)) + if (!memcmp(array[itr], ident, strlen(ident))) return 1; return 0;