Use early exit/continue to simplify code and reduce indentation
This commit is contained in:
parent
c881aa7b32
commit
cfa83658dc
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user