]> git.sesse.net Git - remoteglot/commitdiff
Enable the tbprobe cache.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 23 Mar 2016 19:27:55 +0000 (20:27 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 23 Mar 2016 19:27:55 +0000 (20:27 +0100)
remoteglot.pl

index 9439a4bc4d0b063c59b1eb2738cc9cd0c4b987d5..1b06f05f88c2f29ff65c24ba011817afbd65acec 100755 (executable)
@@ -556,7 +556,7 @@ sub complete_using_tbprobe {
        my $key = join('', @pv);
        my @moves = ();
        if (exists($pos->{'tbprobe_cache'}{$key})) {
        my $key = join('', @pv);
        my @moves = ();
        if (exists($pos->{'tbprobe_cache'}{$key})) {
-               @moves = $pos->{'tbprobe_cache'}{$key};
+               @moves = @{$pos->{'tbprobe_cache'}{$key}};
        } else {
                if ($mpv ne '') {
                        # Force doing at least one move of the PV.
        } else {
                if ($mpv ne '') {
                        # Force doing at least one move of the PV.
@@ -586,6 +586,8 @@ sub complete_using_tbprobe {
                        ($pos, $uci_move) = $pos->make_pretty_move($move);
                        push @moves, $uci_move;
                }
                        ($pos, $uci_move) = $pos->make_pretty_move($move);
                        push @moves, $uci_move;
                }
+
+               $pos->{'tbprobe_cache'}{$key} = \@moves;
        }
 
        $info->{'pv' . $mpv} = \@moves;
        }
 
        $info->{'pv' . $mpv} = \@moves;