Skip to content

Commit

Permalink
perf(traffic_light): add condition to add new traffic light
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota committed Nov 27, 2024
1 parent bb0ff10 commit a536986
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ auto TrafficLightsBase::isTrafficLightAdded(const lanelet::Id traffic_light_id)

auto TrafficLightsBase::addTrafficLight(const lanelet::Id traffic_light_id) -> void
{
if (isTrafficLightAdded(traffic_light_id)) {
return;
}

// emplace will not modify the map if the key already exists
traffic_lights_map_.emplace(
std::piecewise_construct, std::forward_as_tuple(traffic_light_id),
Expand Down

0 comments on commit a536986

Please sign in to comment.