Skip to content

Commit a28315b

Browse files
committed
Comment Hash after Threads
1 parent a5bbe3e commit a28315b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

chess/engine.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,16 +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]]:
1878+
def _chain_config(a: ConfigMapping, b: ConfigMapping) -> Iterable[Tuple[str, ConfigValue]]:
18791879
merged = dict(a)
18801880
for k, v in b.items():
18811881
merged.setdefault(k, v)
1882-
if 'Hash' in merged and 'Threads' in merged:
1883-
hash_val = merged['Hash']
1884-
del merged['Hash']
1885-
merged['Hash'] = hash_val
1886-
for name, value in merged.items():
1887-
yield name, value
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()
18881888

18891889

18901890
class UciOptionMap(MutableMapping[str, T]):

0 commit comments

Comments
 (0)