Skip to content

Conversation

@tmleman
Copy link
Owner

@tmleman tmleman commented Jan 15, 2025

This patch addresses performance warnings reported by cppcheck by changing the way parameters are passed in two functions.

  • In the operator! function, the parameter type is now passed by const reference instead of by value. This avoids unnecessary copying of the parameter, improving performance.
  • In the make_man_page function, the doc_string type is now passed by const reference instead of by value. This change also avoids unnecessary copying and enhances performance.

These changes ensure that the functions are more efficient, especially when dealing with larger objects or complex types.

@tmleman tmleman merged commit 4d04127 into main Jan 15, 2025
3 checks passed
@tmleman tmleman deleted the topic/pr/clipp_h/cppchack/PassingByConstReference branch January 15, 2025 13:07
This patch addresses performance warnings reported by cppcheck by
changing the way parameters are passed in two functions.

- In the `operator!` function, the `parameter` type is now passed by const
reference instead of by value. This avoids unnecessary copying of the
parameter, improving performance.
- In the `make_man_page` function, the `doc_string` type is now passed by
const reference instead of by value. This change also avoids unnecessary
copying and enhances performance.

These changes ensure that the functions are more efficient, especially
when dealing with larger objects or complex types.

Signed-off-by: Tomasz Leman <tomasz.leman@outlook.com>
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