simplify code
This commit is contained in:
		
							parent
							
								
									a5c824f694
								
							
						
					
					
						commit
						f4b192e33c
					
				| @ -122,38 +122,38 @@ template <typename GraphT> class BFSComponentExplorer | |||||||
|             const NodeID u = current_queue_item.second; // parent
 |             const NodeID u = current_queue_item.second; // parent
 | ||||||
|             // increment size counter of current component
 |             // increment size counter of current component
 | ||||||
|             ++current_component_size; |             ++current_component_size; | ||||||
|             const bool is_barrier_node = (m_barrier_nodes.find(v) != m_barrier_nodes.end()); |             if (m_barrier_nodes.find(v) != m_barrier_nodes.end()) | ||||||
|             if (!is_barrier_node) |  | ||||||
|             { |             { | ||||||
|                 const NodeID to_node_of_only_restriction = |                 continue; | ||||||
|                     m_restriction_map.CheckForEmanatingIsOnlyTurn(u, v); |             } | ||||||
|  |             const NodeID to_node_of_only_restriction = | ||||||
|  |                 m_restriction_map.CheckForEmanatingIsOnlyTurn(u, v); | ||||||
| 
 | 
 | ||||||
|                 for (auto e2 : m_graph.GetAdjacentEdgeRange(v)) |             for (auto e2 : m_graph.GetAdjacentEdgeRange(v)) | ||||||
|  |             { | ||||||
|  |                 const NodeID w = m_graph.GetTarget(e2); | ||||||
|  | 
 | ||||||
|  |                 if (to_node_of_only_restriction != std::numeric_limits<unsigned>::max() && | ||||||
|  |                     w != to_node_of_only_restriction) | ||||||
|                 { |                 { | ||||||
|                     const NodeID w = m_graph.GetTarget(e2); |                     // At an only_-restriction but not at the right turn
 | ||||||
|  |                     continue; | ||||||
|  |                 } | ||||||
| 
 | 
 | ||||||
|                     if (to_node_of_only_restriction != std::numeric_limits<unsigned>::max() && |                 if (u != w) | ||||||
|                         w != to_node_of_only_restriction) |                 { | ||||||
|  |                     // only add an edge if turn is not a U-turn except
 | ||||||
|  |                     // when it is at the end of a dead-end street.
 | ||||||
|  |                     if (!m_restriction_map.CheckIfTurnIsRestricted(u, v, w)) | ||||||
|                     { |                     { | ||||||
|                         // At an only_-restriction but not at the right turn
 |                         // only add an edge if turn is not prohibited
 | ||||||
|                         continue; |                         if (std::numeric_limits<unsigned>::max() == m_component_index_list[w]) | ||||||
|                     } |  | ||||||
| 
 |  | ||||||
|                     if (u != w) |  | ||||||
|                     { |  | ||||||
|                         // only add an edge if turn is not a U-turn except
 |  | ||||||
|                         // when it is at the end of a dead-end street.
 |  | ||||||
|                         if (!m_restriction_map.CheckIfTurnIsRestricted(u, v, w)) |  | ||||||
|                         { |                         { | ||||||
|                             // only add an edge if turn is not prohibited
 |                             // insert next (node, parent) only if w has
 | ||||||
|                             if (std::numeric_limits<unsigned>::max() == m_component_index_list[w]) |                             // not yet been explored
 | ||||||
|                             { |                             // mark node as read
 | ||||||
|                                 // insert next (node, parent) only if w has
 |                             m_component_index_list[w] = current_component; | ||||||
|                                 // not yet been explored
 |                             bfs_queue.emplace(w, v); | ||||||
|                                 // mark node as read
 |  | ||||||
|                                 m_component_index_list[w] = current_component; |  | ||||||
|                                 bfs_queue.emplace(w, v); |  | ||||||
|                             } |  | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user