-
Notifications
You must be signed in to change notification settings - Fork 4
Replace array with umap in TrafficLight class #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #290 +/- ##
==========================================
- Coverage 91.10% 89.61% -1.50%
==========================================
Files 38 38
Lines 5441 5141 -300
Branches 478 458 -20
==========================================
- Hits 4957 4607 -350
- Misses 484 534 +50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if (node->isTrafficLight()) { | ||
| auto& trafficLight = dynamic_cast<TrafficLight&>(*node); | ||
| std::unordered_map<Id, std::array<TrafficLightCycle, 3>> newCycles; | ||
| std::unordered_map<Id, std::unordered_map<Direction, TrafficLightCycle>> newCycles; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| } | ||
| m_cycles.emplace(streetId, m_cycles.at(existingCycle)); | ||
| for (auto& cycle : m_cycles.at(streetId)) { | ||
| for (auto& [direction, cycle] : m_cycles.at(streetId)) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| for (auto const& [streetId, cycles] : m_cycles) { | ||
| if (priorityStreets && m_streetPriorities.contains(streetId)) { | ||
| for (auto const& cycle : cycles) { | ||
| for (auto const& [direction, cycle] : cycles) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| } | ||
| } else { | ||
| for (auto const& cycle : cycles) { | ||
| for (auto const& [direction, cycle] : cycles) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| for (auto const& [streetId, cycles] : m_cycles) { | ||
| if (priorityStreets && m_streetPriorities.contains(streetId)) { | ||
| for (auto const& cycle : cycles) { | ||
| for (auto const& [direction, cycle] : cycles) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| break; | ||
| } | ||
| return m_cycles.at(streetId)[direction].isGreen(m_cycleTime, m_counter); | ||
| } else if (m_cycles.at(streetId).contains(Direction::LEFTANDSTRAIGHT)) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 14.4 rule Note
| } | ||
| return m_cycles.at(streetId)[direction].isGreen(m_cycleTime, m_counter); | ||
| } else if (m_cycles.at(streetId).contains(Direction::LEFTANDSTRAIGHT)) { | ||
| direction = Direction::LEFTANDSTRAIGHT; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 17.8 rule Note
| } else if (m_cycles.at(streetId).contains(Direction::LEFTANDSTRAIGHT)) { | ||
| direction = Direction::LEFTANDSTRAIGHT; | ||
| } else { | ||
| return true; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
| if ((priority && m_streetPriorities.contains(streetId)) || | ||
| (!priority && !m_streetPriorities.contains(streetId))) { | ||
| for (auto const& cycle : cycles) { | ||
| for (auto const& [direction, cycle] : cycles) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| for (auto& [direction, cycle] : cycles) { | ||
| cycle.reset(); | ||
| } | ||
| } |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
No description provided.