[Bast-commits] r4871 - Devel-Declare/1.000/trunk
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Sat Oct 4 03:31:42 BST 2008
Author: rafl
Date: 2008-10-04 03:31:41 +0100 (Sat, 04 Oct 2008)
New Revision: 4871
Modified:
Devel-Declare/1.000/trunk/Declare.xs
Log:
Don't call strlen() twice on the same string.
Modified: Devel-Declare/1.000/trunk/Declare.xs
===================================================================
--- Devel-Declare/1.000/trunk/Declare.xs 2008-10-04 02:31:35 UTC (rev 4870)
+++ Devel-Declare/1.000/trunk/Declare.xs 2008-10-04 02:31:41 UTC (rev 4871)
@@ -120,7 +120,7 @@
int new_len = strlen(new_value);
char* old_linestr = SvPVX(PL_linestr);
- SvGROW(PL_linestr, strlen(new_value));
+ SvGROW(PL_linestr, new_len);
if (SvPVX(PL_linestr) != old_linestr)
croak("forced to realloc PL_linestr for line %s, bailing out before we crash harder", SvPVX(PL_linestr));
More information about the Bast-commits
mailing list