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

Avoid std::list if possible #619

Closed
6 tasks done
trisyoungs opened this issue Mar 30, 2021 · 0 comments · Fixed by #970
Closed
6 tasks done

Avoid std::list if possible #619

trisyoungs opened this issue Mar 30, 2021 · 0 comments · Fixed by #970
Assignees

Comments

@trisyoungs
Copy link
Member

trisyoungs commented Mar 30, 2021

std::list is very useful as a container since it maintains references to objects on insertion / deletion (unlike std::vector) however it it has a larger footprint per item in the container, and does not store objects contiguously in memory. It should be replaced with other containers where possible to do so:

Current Uses

  • Data1DStore (as std::list<std::pair<Data1D, Data1DImportFileFormat>>)
  • Data2DStore (as std::list<std::pair<Data2D, Data2DImportFileFormat>>)
  • Data3DStore (as std::list<std::pair<Data3D, Data3DImportFileFormat>>)
  • CoreData (as std::list<MasterIntra>) - it appears all std::list usages have been replaced with std::vector
  • SpeciesAtom (as std::list<SpeciesAtom>) - it appears all std::list usages have been replaced with std::vector
  • Several GUI helper functions (combopopulator.h, tablewidgetupdater.h, treewidgetupdater.h) take std::list as data.
@IVlaD17 IVlaD17 self-assigned this Feb 9, 2022
IVlaD17 added a commit that referenced this issue Feb 16, 2022
IVlaD17 added a commit that referenced this issue Feb 16, 2022
IVlaD17 added a commit that referenced this issue Mar 7, 2022
IVlaD17 added a commit that referenced this issue Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants