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

Move, not copy, Logger and Handler functors #1576

Merged
merged 4 commits into from
Jun 2, 2023

Conversation

db-src
Copy link
Contributor

@db-src db-src commented Jun 1, 2023

Hi, and thanks a lot for the nice little library!

Here are a few minor improvements:

  • Explicitly #include for use of std::move [rather than relying on indirect include]
  • Move not copy Logger arg from Client to ClientImpl [will avoid copying heavy functors]
  • Move not copy, set_error_handler Handler to lambda [ditto]
  • Remove null statement in non-empty if/else block [I guess it was a relic from a time before the other statement was added.]

We might also consider whether to move string() arguments such as these from arguments into their destination - what do you think?

image

@db-src db-src changed the title Move logger to cli impl Move, not copy, Logger functor from Client into ClientImp Jun 1, 2023
@db-src db-src changed the title Move, not copy, Logger functor from Client into ClientImp Move, not copy, Logger functor from Client into ClientImpl Jun 1, 2023
@db-src db-src changed the title Move, not copy, Logger functor from Client into ClientImpl Move, not copy, Logger and Handler functors Jun 1, 2023
I guess it was a relic from a time before the other statement was added.
@yhirose
Copy link
Owner

yhirose commented Jun 2, 2023

@db-src looks good to me. I'll merge it. As for string(), I am ok with the existing code. Thanks for the improvement!

@yhirose yhirose merged commit 698a1e5 into yhirose:master Jun 2, 2023
@db-src db-src deleted the move-logger-to-cli-impl branch June 2, 2023 08:34
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