fix: code correctness, security, and simplicity improvements

This commit is contained in:
2026-08-13 21:23:15 +03:00
parent ac6efb45d8
commit e063d26d4c
5 changed files with 78 additions and 40 deletions

View File

@@ -253,11 +253,11 @@ func (g *Graph) FindRoute(originID, destID string, opts SearchOptions) *Itinerar
newDurationWithMCT := newDuration + transferTime
// Check if we've visited this node with fewer or equal transfers
// Check if we've visited this node with fewer transfers
visKey := current.nodeID
if existingTransfers, ok := visited[visKey]; ok {
if current.transfers+1 >= existingTransfers {
// Already visited this node with fewer or equal transfers, skip
if current.transfers+1 > existingTransfers {
// Already visited this node with fewer transfers, skip
continue
}
}