Commit 6fb1ed5a authored by Torsten Schönfeld's avatar Torsten Schönfeld

Calculate a string length more efficiently

parent 5f2dba87
......@@ -279,7 +279,10 @@ read_func_marshaller (void *closure,
SvREFCNT_dec (sv);
} else {
SV *retval = POPs;
memcpy (data, SvPV_nolen (retval), sv_len (retval));
STRLEN len = 0;
const char *sv_data = SvPV (retval, len);
/* should we assert that len == length? */
memcpy (data, sv_data, len);
}
PUTBACK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment