]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Use memcmp with strlen for correct_exists (it's a hell of a lot faster)
authorDale Weiler <killfieldengine@gmail.com>
Sun, 6 Jan 2013 03:34:56 +0000 (03:34 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sun, 6 Jan 2013 03:34:56 +0000 (03:34 +0000)
correct.c

index 3926441a89c17c57e6393adf14a28a92bb38006d..407d06a5b210b116b18e528d67e42c8a1b5d5896 100644 (file)
--- 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;