mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-11 08:15:34 +03:00
eliminate first_from - we go around just once
This commit is contained in:
parent
52a26f8a12
commit
933127f021
@ -76,9 +76,8 @@ pub fn make_walking_turns(map: &Map, i: &Intersection) -> Vec<Turn> {
|
||||
let mut result: Vec<Turn> = Vec::new();
|
||||
|
||||
let mut from: Option<&Lane> = lanes[0];
|
||||
let first_from = from.unwrap().id;
|
||||
let mut adj = true;
|
||||
for l in lanes.iter().skip(1).chain(lanes.iter()) {
|
||||
for l in lanes.iter().skip(1).chain(lanes.iter().take(1)) {
|
||||
if from.is_none() {
|
||||
from = *l;
|
||||
adj = true;
|
||||
@ -110,11 +109,6 @@ pub fn make_walking_turns(map: &Map, i: &Intersection) -> Vec<Turn> {
|
||||
from = Some(l2);
|
||||
adj = true;
|
||||
}
|
||||
|
||||
// Have we made it all the way around?
|
||||
if first_from == from.unwrap().id {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If there are exactly two crosswalks they must be connected, so delete one.
|
||||
|
Loading…
Reference in New Issue
Block a user