Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Takagi <[email protected]>
  • Loading branch information
yuki-takagi-66 committed Jan 31, 2024
1 parent 68c214b commit 40fe812
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1233,9 +1233,10 @@ PredictedObject MapBasedPredictionNode::getPredictedObjectAsCrosswalkUser(
for (const auto & crosswalk : crosswalks_) {
const auto crosswalk_signal_id_opt = getTrafficSignalId(crosswalk);
if (crosswalk_signal_id_opt.has_value() && use_crosswalk_signal_) {
const auto signal_element_opt = getTrafficSignalElement(crosswalk_signal_id_opt.value());
const auto signal_color =
signal_element_opt ? signal_element_opt.value().color : TrafficSignalElement::UNKNOWN;
const auto signal_color = [&] {
const auto elem_opt = getTrafficSignalElement(crosswalk_signal_id_opt.value());
return elem_opt ? elem_opt.value().color : TrafficSignalElement::UNKNOWN;
}();

Check warning on line 1239 in perception/map_based_prediction/src/map_based_prediction_node.cpp

View check run for this annotation

Codecov / codecov/patch

perception/map_based_prediction/src/map_based_prediction_node.cpp#L1234-L1239

Added lines #L1234 - L1239 were not covered by tests

if (signal_color == TrafficSignalElement::RED) {
continue;

Check warning on line 1242 in perception/map_based_prediction/src/map_based_prediction_node.cpp

View check run for this annotation

Codecov / codecov/patch

perception/map_based_prediction/src/map_based_prediction_node.cpp#L1241-L1242

Added lines #L1241 - L1242 were not covered by tests
Expand Down

0 comments on commit 40fe812

Please sign in to comment.