Skip to content
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

Use std::unordered_map for tmpDataByArea_ (hydro ventilation) #1855

Merged
merged 2 commits into from
Dec 29, 2023

Conversation

flomnes
Copy link
Member

@flomnes flomnes commented Dec 29, 2023

Why ?

Using a std::vector requires one 2 indirections area -> index -> tmpData

Using a std::unordered_map, we don't need to worry about indices anymore, we can just get area -> tmpData.

NOTES

  • The AreaList shall never be resized after assigning the newly created map. Otherwise pointers used as keys would be invalid. This works because no areas are added/removed after loading a study.
  • Replacing a std::vector by a std::unordered_map works because we don't rely on order. If we did, using pointers as map keys would produce unpredictable results.

Copy link

watermelon-copilot-for-code-review bot commented Dec 29, 2023

Watermelon AI Summary

AI Summary deactivated by flomnes

GitHub PRs

Antares_Simulator is an open repo and Watermelon will serve it for free.
🍉🫶

Copy link

sonarcloud bot commented Dec 29, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

4 New issues
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@flomnes flomnes merged commit 608c5b6 into develop Dec 29, 2023
6 checks passed
@flomnes flomnes deleted the fix/unordered-map branch December 29, 2023 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants