Use early exit/continue to simplify code and reduce indentation

This commit is contained in:
Dennis Luxen 2015-01-22 12:39:41 +01:00
parent c881aa7b32
commit cfa83658dc

View File

@ -145,8 +145,11 @@ bool RestrictionMap::CheckIfTurnIsRestricted(const NodeID node_u,
}
const auto restriction_iter = m_restriction_map.find({node_u, node_v});
if (restriction_iter != m_restriction_map.end())
if (restriction_iter == m_restriction_map.end())
{
return false;
}
const unsigned index = restriction_iter->second;
const auto &bucket = m_restriction_bucket_list.at(index);
@ -163,7 +166,6 @@ bool RestrictionMap::CheckIfTurnIsRestricted(const NodeID node_u,
return true;
}
}
}
return false;
}