File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1875,12 +1875,16 @@ def _parse_uci_bestmove(board: chess.Board, args: str) -> BestMove:
18751875 return BestMove (move , ponder )
18761876
18771877
1878- def _chain_config (a : ConfigMapping , b : ConfigMapping ) -> Iterator [Tuple [str , ConfigValue ]]:
1879- for name , value in a .items ():
1880- yield name , value
1881- for name , value in b .items ():
1882- if name not in a :
1883- yield name , value
1878+ def _chain_config (a : ConfigMapping , b : ConfigMapping ) -> Iterable [Tuple [str , ConfigValue ]]:
1879+ merged = dict (a )
1880+ for k , v in b .items ():
1881+ merged .setdefault (k , v )
1882+ if "Hash" in merged and "Threads" in merged :
1883+ # Move Hash after Threads, as recommended by Stockfish.
1884+ hash_val = merged ["Hash" ]
1885+ del merged ["Hash" ]
1886+ merged ["Hash" ] = hash_val
1887+ return merged .items ()
18841888
18851889
18861890class UciOptionMap (MutableMapping [str , T ]):
You can’t perform that action at this time.
0 commit comments