]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
p_strdup(): Small optimization.
authorTimo Sirainen <tss@iki.fi>
Tue, 10 Aug 2010 12:03:20 +0000 (13:03 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 10 Aug 2010 12:03:20 +0000 (13:03 +0100)
Patch by Len7hir

src/lib/strfuncs.c

index f6569910b5163fd2ce05c1a4e202bbc999334472..04d012156912fab58e756656875e58e3f43132ac 100644 (file)
@@ -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;