Remove debug prints and fix build warnings
- Remove all print statements from planning engine, data providers, and PDF generation - Fix deprecated CLGeocoder usage with MKLocalSearch for iOS 26 - Fix Swift 6 actor isolation by converting PDFGenerator/ExportService to @MainActor - Add @retroactive to CLLocationCoordinate2D protocol conformances - Fix unused variable warnings in GameDAGRouter and scenario planners - Remove unreachable catch blocks in SettingsViewModel 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -92,8 +92,6 @@ enum GameDAGRouter {
|
||||
|
||||
guard !sortedDays.isEmpty else { return [] }
|
||||
|
||||
print("[GameDAGRouter] \(games.count) games across \(sortedDays.count) days")
|
||||
print("[GameDAGRouter] Games per day: \(sortedDays.map { buckets[$0]?.count ?? 0 })")
|
||||
|
||||
// Step 3: Initialize beam with first day's games
|
||||
var beam: [[Game]] = []
|
||||
@@ -113,10 +111,9 @@ enum GameDAGRouter {
|
||||
}
|
||||
}
|
||||
|
||||
print("[GameDAGRouter] Initial beam size: \(beam.count)")
|
||||
|
||||
// Step 4: Expand beam day by day
|
||||
for (index, dayIndex) in sortedDays.dropFirst().enumerated() {
|
||||
for (_, dayIndex) in sortedDays.dropFirst().enumerated() {
|
||||
let todaysGames = buckets[dayIndex] ?? []
|
||||
var nextBeam: [[Game]] = []
|
||||
|
||||
@@ -131,14 +128,11 @@ enum GameDAGRouter {
|
||||
continue
|
||||
}
|
||||
|
||||
var addedAny = false
|
||||
|
||||
// Try adding each of today's games
|
||||
for candidate in todaysGames {
|
||||
if canTransition(from: lastGame, to: candidate, stadiums: stadiums, constraints: constraints) {
|
||||
let newPath = path + [candidate]
|
||||
nextBeam.append(newPath)
|
||||
addedAny = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +142,6 @@ enum GameDAGRouter {
|
||||
|
||||
// Dominance pruning + beam truncation
|
||||
beam = pruneAndTruncate(nextBeam, beamWidth: beamWidth, stadiums: stadiums)
|
||||
print("[GameDAGRouter] Day \(dayIndex): nextBeam=\(nextBeam.count), after prune=\(beam.count), max games=\(beam.map { $0.count }.max() ?? 0)")
|
||||
}
|
||||
|
||||
// Step 5: Filter routes that contain all anchors
|
||||
@@ -160,15 +153,7 @@ enum GameDAGRouter {
|
||||
// Step 6: Ensure geographic diversity in results
|
||||
// Group routes by their primary region (city with most games)
|
||||
// Then pick the best route from each region
|
||||
let diverseRoutes = selectDiverseRoutes(routesWithAnchors, stadiums: stadiums, maxCount: maxOptions)
|
||||
|
||||
print("[GameDAGRouter] Found \(routesWithAnchors.count) routes with anchors, returning \(diverseRoutes.count) diverse routes")
|
||||
for (i, route) in diverseRoutes.prefix(5).enumerated() {
|
||||
let cities = route.compactMap { stadiums[$0.stadiumId]?.city }.joined(separator: " → ")
|
||||
print("[GameDAGRouter] Route \(i+1): \(route.count) games - \(cities)")
|
||||
}
|
||||
|
||||
return diverseRoutes
|
||||
return selectDiverseRoutes(routesWithAnchors, stadiums: stadiums, maxCount: maxOptions)
|
||||
}
|
||||
|
||||
/// Compatibility wrapper that matches GeographicRouteExplorer's interface.
|
||||
@@ -320,7 +305,6 @@ enum GameDAGRouter {
|
||||
return score1 > score2
|
||||
}
|
||||
|
||||
print("[GameDAGRouter] Found \(sortedRegions.count) distinct regions: \(sortedRegions.prefix(10).joined(separator: ", "))")
|
||||
|
||||
// Pick routes round-robin from each region to ensure diversity
|
||||
var selectedRoutes: [[Game]] = []
|
||||
|
||||
Reference in New Issue
Block a user