]> git.sesse.net Git - remoteglot/commitdiff
Small microoptimization in Board::clone.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 20 Sep 2014 12:09:22 +0000 (14:09 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 20 Sep 2014 12:09:22 +0000 (14:09 +0200)
Board.pm

index ff2828af82b03c60f6e2fcef4dd341e8d2d6ed0e..3d832781bc2b1d4dc84b89daa3b933b2d57dcdd0 100644 (file)
--- a/Board.pm
+++ b/Board.pm
@@ -25,9 +25,7 @@ sub clone {
        my $nb = [];
 
        for my $row (0..7) {
-               for my $col (0..7) {
-                       $nb->[$row][$col] = $board->[$row][$col];
-               }
+               $nb->[$row] = [ @{$board->[$row]} ];
        }
 
        return bless $nb;