Repository navigation
Open
Description
DataProcessing/siteupdate/cplusplus/classes/GraphGeneration/PlaceRadius.cpp
Lines 91 to 92 in 387c99b
| if ( (!p->colocated || p == p->colocated->front()) | |
| && p->is_or_colocated_with_active_or_preview() |
Either...
- Vertices have already been created, and linked to their respective Waypoints.
All of this could be replaced with a simpleif (p->vertex), but firstWaypoint::vertexmust be 0ed on construction; right now it's uninitialized until vertex setup.
Side benefit: if any future changes use the initial value of non-vertex Waypoints, dereferencing a null pointer rather than reading/writing thru a garbage pointer should be easier to debug. - If the writes to every Waypoint are actually less efficient, we can get rid of the extraneous colocation check in
is_or_colocated_with_active_or_previewby using a lambda:// first check if this is a terminal quadrant, and if it is, // we search for vertices within this quadrant if (!qt->refined()) for (Waypoint *p : qt->points) { auto graph_point = [=]() { if (!p->colocated) return p->route->system->active_or_preview(); if (p != p->colocated->front()) return false; for (Waypoint* w : *p->colocated) if (w->route->system->active_or_preview()) return true; return false; }; if ( graph_point() && contains_vertex(p->lat, p->lng) && p->region_match(gle.regions) && p->system_match(gle.systems) ){ vvec.push_back(p->vertex); hg->add_to_subgraph(p->vertex, threadnum); } }
Activity