browser: prepare intermediate variable of flat cell versions
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 27 Apr 2017 19:57:14 +0000 (21:57 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 29 May 2017 17:21:27 +0000 (19:21 +0200)
browser.plp

index effda37..c609a57 100644 (file)
@@ -389,7 +389,8 @@ sub saybrowsercols {
                        || 'u'                       # unsure
                );
                unless (!defined $prev or $prev ~~ $compare) {
-                       my $usage = sum(@{ $canihas->{$browser} }{ map { @{$_} } @span });
+                       my @vercover = (map { @{$_} } @span);
+                       my $usage = sum(@{ $canihas->{$browser} }{@vercover});
 
                        # strip #\d note references from support class
                        my @notes;
@@ -398,13 +399,13 @@ sub saybrowsercols {
 
                        # prepare version hover details
                        my $title = sprintf('%.1f%% %s', $usage * $usagepct, join(' ',
-                               (map { ref $_ eq 'CODE' ? $_->($browser, $span[0]->[0]) : $_ }
+                               (map { ref $_ eq 'CODE' ? $_->($browser, $vercover[0]) : $_ }
                                 map { $DSTATS{$_} // () }
                                 map { split / /, $_ }
                                 $prev
                                ),
                                'in', $caniuse->{agents}->{$browser}->{abbr},
-                               showversions((map { @{$_} } @span), undef),
+                               showversions(@vercover, undef),
                        ));
                        $title .= "\n$_" for notestotitle(@notes);