-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
std::unordered_map
for tmpDataByArea_ (hydro ventilation) (#1855)
## 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.
- Loading branch information
Showing
4 changed files
with
22 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters