There's no point in always duplicating the sample, just ensure it's
writable, as was done prior to the smp_dup() change. This should be
backported to 1.6 to avoid a performance regression caused by this
change (about 30% more time for upper/lower due to the copy).
{
int i;
- if (!smp_dup(smp))
- return 0;
-
- if (!smp->data.u.str.size)
+ if (!smp_make_rw(smp))
return 0;
for (i = 0; i < smp->data.u.str.len; i++) {
{
int i;
- if (!smp_dup(smp))
- return 0;
-
- if (!smp->data.u.str.size)
+ if (!smp_make_rw(smp))
return 0;
for (i = 0; i < smp->data.u.str.len; i++) {