From aeb5fd46c7a4427ba13d9d75947006dee5fb0a20 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 26 Mar 2009 16:35:00 +0100 Subject: optimize the exact length of the template is known, so there is no point in using the more complex (and thus potentially slower) strncmp instead of memcmp. --- src/corelib/kernel/qtranslator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 1eca817..77d6599 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -95,7 +95,7 @@ static bool match(const uchar* found, const char* target, uint len) // (normalize it to be without the zero-terminating symbol) if (len > 0 && found[len-1] == '\0') --len; - return (qstrncmp((const char *)found, target, len) == 0 && target[len] == '\0'); + return (memcmp(found, target, len) == 0 && target[len] == '\0'); } static uint elfHash(const char *name) -- cgit v0.12