mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Try all pairs of choices, not just a small subset via zip
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
import itertools
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
import multihash
|
import multihash
|
||||||
@ -180,7 +181,7 @@ def _select_parameter_from_order(
|
|||||||
else:
|
else:
|
||||||
return supported_parameters.split(",")[0]
|
return supported_parameters.split(",")[0]
|
||||||
|
|
||||||
for first, second in zip(first_choices, second_choices):
|
for first, second in itertools.product(first_choices, second_choices):
|
||||||
if first == second:
|
if first == second:
|
||||||
return first
|
return first
|
||||||
raise IncompatibleChoices()
|
raise IncompatibleChoices()
|
||||||
|
|||||||
Reference in New Issue
Block a user