fix: address code review findings

This commit is contained in:
2026-08-17 23:12:24 +03:00
parent 6dcec6a7a5
commit 9b89b7b9ab
2 changed files with 18 additions and 9 deletions

View File

@@ -343,7 +343,9 @@ func (g *Graph) FindRoute(originID, destID string, opts SearchOptions, closedSta
}
}
}
} // Build adjacency list from edges
}
// Build adjacency list from edges
adj := g.buildAdjacencyList()
// BFS with transfer tracking
@@ -976,7 +978,7 @@ type HubStation struct {
// rule from the transfer rules, or returns the default MCT.
func getMCTForTransfer(optsMCT int, g *Graph) int {
// Default MCT if no rules match
defaultMCT := 1800 // 30 minutes
defaultMCT := storage.DefaultMCT // 30 minutes
// If the user explicitly set an MCT via SearchOptions, prefer that
if optsMCT > 0 {
@@ -984,11 +986,10 @@ func getMCTForTransfer(optsMCT int, g *Graph) int {
}
// Try to determine MCT from node types in the graph
// This is a simplified lookup; in a full implementation, this would
// query the transfer_rules table from the database
// In a full implementation, this would query the transfer_rules table
// from the database using storage.MinTransferTime(ruleKey, rules, defaultMCT)
// For now, return the default MCT.
// For now, return the default MCT. In a full implementation,
// this would query the transfer_rules table.
return defaultMCT
}