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

Minor improvements to template function handling. Preliminary for the work in PR#230 #234

Merged
merged 1 commit into from
Apr 30, 2019
Merged

Minor improvements to template function handling. Preliminary for the work in PR#230 #234

merged 1 commit into from
Apr 30, 2019

Conversation

jonesmz
Copy link
Contributor

@jonesmz jonesmz commented Apr 26, 2019

No description provided.

@@ -9491,47 +9491,6 @@ class endpoint : public std::enable_shared_from_this<endpoint<Socket, Mutex, Loc
}
}

void send_publish_no_lifetime(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to put this in and then take it out, but after considering it more, I don't think that this function needs to have two different versions. The second version essentially only saved a single conditional, after the optimizer finished with it.

std::vector<std::uint8_t> params;
async_send_unsuback(std::move(params), packet_id, qos, std::forward<Args>(args)..., async_handler_t());
Args&&... qos) {
async_send_unsuback(std::vector<std::uint8_t>({qos...}), packet_id, async_handler_t());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do parameter pack expansion to create the vector directly. No need for recursion.

@redboltz redboltz merged commit c624d0b into redboltz:master Apr 30, 2019
@redboltz
Copy link
Owner

Thank you!

@jonesmz jonesmz deleted the minor_improvements branch May 1, 2019 01:30
redboltz pushed a commit that referenced this pull request Oct 3, 2019
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