Combine statements

This commit is contained in:
glax 2023-05-17 19:08:10 +02:00
parent 371989b34d
commit 9f0d47ed59

View File

@ -66,10 +66,9 @@ namespace Pathfinding
public bool TestValidConnectionForType(OsmNode node1, OsmNode node2, SpeedType type)
{
foreach (OsmEdge edge in node1.edges)
foreach (OsmEdge edge in node1.edges.Where(edge => edge.neighborId.Equals(node2.nodeId)))
{
if (edge.neighborId.Equals(node2.nodeId))
return TestValidConnectionForType(node1, edge, type);
return TestValidConnectionForType(node1, edge, type);
}
return false;