a round of clippy

This commit is contained in:
Dustin Carlino 2019-04-15 18:19:31 -07:00
parent b610139f89
commit 7885477e59
5 changed files with 25 additions and 4 deletions

View File

@ -3,6 +3,8 @@
## Boundary clipping
- lakes missing from small_seattle
- just connecting the ends of ways doesnt always work well
- maybe increase the Bounds for areas, and let clipping clean up later?
- some border intersections have weird OOBish geometry, or the arrows look weird
- simplify border node detection, only do it in convert_osm?

View File

@ -446,3 +446,14 @@ egregious edge cases look like.
- lets just separately index them. shrug. ideally part of the TurnID, but oh well.
- How can we display the turn itself in response to warp?
- need to poke turn cycler from warp?
## Faster pathfinding
https://pdfs.semanticscholar.org/36d1/b4ec6a4a2823e9c875318f1952df4abf4876.pdf
- do a bunch of pathfinding queries normally
- then look for common shared sequences
- cache those paths, then anytime normal pathfinding later hits a node, be able to jump to any destination with known cost
- but will the better heuristic to the goal make us actually search those?
- or just use intersections between big roads as these landmarks, precompute paths between them

View File

@ -29,9 +29,17 @@ impl UI {
fn new(flags: Flags, prerender: &Prerender) -> UI {
// TODO Consolidate with sim::load
let map: Map = if flags.load_map.starts_with(Path::new("../data/raw_maps/")) {
Map::new(&flags.load_map, &mut Timer::new("load map")).unwrap()
Map::new(
flags.load_map.to_str().unwrap(),
&mut Timer::new("load map"),
)
.unwrap()
} else {
abstutil::read_binary(&flags.load_map, &mut Timer::new("load map")).unwrap()
abstutil::read_binary(
flags.load_map.to_str().unwrap(),
&mut Timer::new("load map"),
)
.unwrap()
};
UI {

View File

@ -631,7 +631,7 @@ impl Map {
for t in make::make_all_turns(i, &self.roads, &self.lanes, timer) {
add_turns.insert(t.id);
i.turns.push(t.id);
if let Some(_existing_t) = old_turns.iter().find(|t| t.id == t.id) {
if let Some(_existing_t) = old_turns.iter().find(|turn| turn.id == t.id) {
// TODO Except for lookup_idx
//assert_eq!(t, *existing_t);
}

View File

@ -220,7 +220,7 @@ impl State {
.waiting
.iter()
.position(|r| r == req)
.unwrap_or(self.waiting.len());
.unwrap_or_else(|| self.waiting.len());
if self.waiting[0..this_idx]
.iter()
.any(|r| sign.turns[&r.turn] == this_priority)