Skip to content

Commit

Permalink
Stop calling get-magic twice in sprintf "%1s", $utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
Father Chrysostomos committed Aug 31, 2012
1 parent 3f63b0e commit 4b8b610
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sv.c
Original file line number Diff line number Diff line change
Expand Up @@ -10526,7 +10526,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
if (has_precis && precis < elen)
width += precis - old_precis;
else
width += elen - sv_len_utf8(argsv);
width += elen - sv_len_utf8_nomg(argsv);
}
is_utf8 = TRUE;
}
Expand Down
3 changes: 2 additions & 1 deletion t/op/tie_fetch_count.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
plan (tests => 308);
plan (tests => 309);
}

use strict;
Expand Down Expand Up @@ -254,6 +254,7 @@ $dummy = pack "u", $var; check_count 'pack "u", $utf8';

tie $var, "main", "\x{100}";
pos$var = 0 ; check_count 'lvalue pos $utf8';
$dummy=sprintf"%1s",$var; check_count 'sprintf "%1s", $utf8';
$dummy = substr$var,0,1; check_count 'substr $utf8';
my $l =\substr$var,0,1;
$dummy = $$l ; check_count 'reading lvalue substr($utf8)';
Expand Down

0 comments on commit 4b8b610

Please sign in to comment.