argh, bus route IDs were totally out of sync with reality
@@ -107,9 +107,8 @@ pub fn make_bus_stops(
pub fn verify_bus_routes(map: &Map, routes: Vec<BusRoute>, timer: &mut Timer) -> Vec<BusRoute> {
timer.start_iter("verify bus routes are connected", routes.len());
- routes
- .into_iter()
- .filter(|r| {
+ let mut results = Vec::new();
+ for mut r in routes {
timer.next();
let mut ok = true;
for (stop1, stop2) in r
@@ -148,7 +147,11 @@ pub fn verify_bus_routes(map: &Map, routes: Vec<BusRoute>, timer: &mut Timer) ->
break;
}
}
- ok
- })
- .collect()
+
+ if ok {
+ r.id = BusRouteID(results.len());
+ results.push(r);
+ }
+ }
+ results
}
