From: Timo Sirainen Date: Tue, 10 Aug 2010 12:03:20 +0000 (+0100) Subject: p_strdup(): Small optimization. X-Git-Tag: 2.0.rc5~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b44edec39ae57b48e382e8c2b05ac94307f8d167;p=thirdparty%2Fdovecot%2Fcore.git p_strdup(): Small optimization. Patch by Len7hir --- diff --git a/src/lib/strfuncs.c b/src/lib/strfuncs.c index f6569910b5..04d0121569 100644 --- a/src/lib/strfuncs.c +++ b/src/lib/strfuncs.c @@ -36,10 +36,7 @@ char *p_strdup(pool_t pool, const char *str) if (str == NULL) return NULL; - for (len = 0; (str)[len] != '\0'; ) - len++; - len++; - + len = strlen(str) + 1; mem = p_malloc(pool, len); memcpy(mem, str, len); return mem;