From 883ca75991e4001679d6549b3176b479ec9e4d19 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 18 Oct 2020 06:03:40 -0700 Subject: [PATCH] remove 'map' from sub 'copy_token_as_type' for efficiency --- lib/Perl/Tidy/Formatter.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 0e6edec5..be46c90e 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -5315,13 +5315,13 @@ sub copy_token_as_type { ); } - my $rnew_token = [ map { $_ } @{$rold_token} ]; - $rnew_token->[_TYPE_] = $type; - $rnew_token->[_TOKEN_] = $token; - $rnew_token->[_BLOCK_TYPE_] = ''; - $rnew_token->[_CONTAINER_ENVIRONMENT_] = ''; - $rnew_token->[_TYPE_SEQUENCE_] = ''; - return $rnew_token; + my @rnew_token = @{$rold_token}; + $rnew_token[_TYPE_] = $type; + $rnew_token[_TOKEN_] = $token; + $rnew_token[_BLOCK_TYPE_] = ''; + $rnew_token[_CONTAINER_ENVIRONMENT_] = ''; + $rnew_token[_TYPE_SEQUENCE_] = ''; + return \@rnew_token; } sub Debug_dump_tokens { -- 2.39.5