Use sequentialSwaps for cyclical routes

This commit is contained in:
johnwhitton
2025-09-11 08:21:16 -07:00
parent a26e7cb518
commit 01fffa645b

View File

@@ -103,7 +103,9 @@ impl TychoRouterEncoder {
solution
.swaps
.iter()
.all(|swap| swap.split == 0.0))
.all(|swap| swap.split == 0.0) &&
!(solution.given_token == solution.checked_token && solution.swaps.len() > 2))
// This is a special case for cyclical swaps
{
self.single_swap_strategy
.encode_strategy(solution)?