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

Fixes as suggested by clang-tidy. #193

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Conversation

leeN
Copy link
Collaborator

@leeN leeN commented Jan 18, 2024

  • Cleaned up std::move usage

This includes removing invocations where it does not have any impact, e.g., moving ints or arrays. I also added std::move calls for types where it improves performance, such as strings or std::vector.

  • Added noexcept modifier to move constructors

  • Added parentheses where they were missing.

  • Added pointer qualifier to auto declarations

  • Added checks to prevent broken objects in case of self assignments

For example for TaintFlow the assignment constructor first releases its own resources. If a self assignment TaintFlow f = flow; takes place, this would mean we release the resources and then try to use them, which is obviously problematic.

  • Removed some superfluous copies by using references.

- Cleaned up std::move usage

This includes removing invocations where it does not have any impact,
e.g., moving ints or arrays. I also added std::move calls for types
where it improves performance, such as strings or std::vector.

- Added noexcept modifier to move constructors

- Added parentheses where they were missing.

- Added pointer qualifier to auto declarations

- Added checks to prevent broken objects in case of self
  assignments

For example for TaintFlow the assignment constructor first releases
its own resources. If a self assignment TaintFlow f = flow; takes
place, this would mean we release the resources and then try to use
them, which is obviously problematic.

- Removed some superfluous copies by using references.
@tmbrbr tmbrbr self-requested a review January 18, 2024 13:24
@tmbrbr tmbrbr merged commit e6d69a1 into SAP:main Jan 22, 2024
4 of 5 checks passed
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.

2 participants