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

Refactors and fix potential memory leak #58

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

yunimoo
Copy link

@yunimoo yunimoo commented Jul 16, 2024

Items in this PR address potential performance gains by:

  • Moving constructor assignments into initialization lists
  • Favor pre-increment over post-increment on iterators
  • Safety for certain function arguments that are not modified
  • Preventing a potential memory leak by freeing pointer reference before assignment
  • Remove unnecessary lines for variables no longer referenced later in the cycle

The purpose of this commit is to move parameters that otherwise would be
assigned in the constructor to the initialization list. This could increase
performance by avoiding a call to the default constructor.
The purpose of this commit is to remove lines that are never referenced
again.
The changes proposed in this commit are to improve the performance of an
iterator by pre-increment style.
This commit aims to prevent a potential memory leak given that memory
could be referenced by the pointer. Freeing the pointer first, then
assigning to new memory space should prevent this.
@yunimoo yunimoo force-pushed the refactor-initialization-list branch from 3ad1779 to c38c91d Compare July 16, 2024 23:12
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 this pull request may close these issues.

1 participant