dovecot-2.0: p_strdup(): Small optimization.

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 10 15:03:29 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/7f550a7bd9d7
changeset: 11972:7f550a7bd9d7
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 10 13:03:20 2010 +0100
description:
p_strdup(): Small optimization.
Patch by Len7hir

diffstat:

 src/lib/strfuncs.c |  5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diffs (15 lines):

diff -r 88309dcfdab5 -r 7f550a7bd9d7 src/lib/strfuncs.c
--- a/src/lib/strfuncs.c	Mon Aug 09 19:59:19 2010 +0100
+++ b/src/lib/strfuncs.c	Tue Aug 10 13:03:20 2010 +0100
@@ -36,10 +36,7 @@
 	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;


More information about the dovecot-cvs mailing list