]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwCoderepo.pm
www_coderepo: reduce utf8::decode calls
[public-inbox.git] / lib / PublicInbox / WwwCoderepo.pm
index 4d8713b41cdbdfd6e8134b8dc4b22df29888548c..8df6116a79b230d0c5d27e8e393523ce8d0b643f 100644 (file)
@@ -124,7 +124,6 @@ EOM
        $last = pop(@r) if scalar(@r) > $ctx->{wcr}->{summary_branches};
        for (@r) {
                my ($pfx, $oid, $ref, $s, $cd) = split(/\0/);
-               utf8::decode($_) for ($ref, $s);
                chomp $cd;
                my $align = length($ref) < 12 ? ' ' x (12 - length($ref)) : '';
                print $zfh "$pfx <a\nhref=./$oid/s/>", ascii_html($ref),
@@ -148,7 +147,6 @@ EOM
        }
        for (@r) {
                my (undef, $oid, $ref, $s, $cd) = split(/\0/);
-               utf8::decode($_) for ($ref, $s);
                chomp $cd;
                my $align = length($ref) < 12 ? ' ' x (12 - length($ref)) : '';
                print $zfh "<a\nhref=./$oid/s/>", ascii_html($ref),
@@ -169,6 +167,7 @@ EOM
 sub capture_refs ($$) { # psgi_qx callback to capture git-for-each-ref + git-log
        my ($bref, $ctx) = @_;
        my $qsp_err = delete $ctx->{-qsp_err};
+       utf8::decode($$bref);
        $ctx->{-each_refs} = $$bref;
        summary_finish($ctx) if $ctx->{-readme};
 }