From 3af63ea303194faa7ebfa2816ae70dd0ee531a40 Mon Sep 17 00:00:00 2001 From: gashapwn Date: Sun, 4 Apr 2021 23:25:25 +0000 Subject: [PATCH] lpst.pl - refactored shade_move to remove redundant arrays --- lpst.pl | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lpst.pl b/lpst.pl index b554015..275cc89 100644 --- a/lpst.pl +++ b/lpst.pl @@ -589,26 +589,21 @@ sub shade_move($$){ my ($not, $en) = (shift, shift); my $c1; my @mv1; - my @mv2; $c1 = cell_pi($not); - @mv1 = map { - $_ - } grep { - ($_->{"type"} && $en) eq $en - }@{$MOVE{$c1}}; - - @mv2 = grep { + @mv1 = grep { $_ if $_->[0] ne $ERR_C_1; } map { [ calc_move($not, $_->{"mov"}), $_->{"type"} ] - } @mv1; + } grep { + ($_->{"type"} && $en) eq $en + } @{$MOVE{$c1}}; - for my $mv (@mv2){ + for my $mv (@mv1){ shade_cell($mv->[0], $mv->[1]); } }