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

Refactor recent messages API #4763

Merged
merged 5 commits into from
Aug 12, 2023
Merged

Conversation

pajlada
Copy link
Member

@pajlada pajlada commented Aug 12, 2023

Description

This exposes internal functions for testing by splitting the implementation & internal API into separate files

This exposes internal functions for testing
@pajlada pajlada force-pushed the chore/refactor-recent-messages-api branch from 3205776 to fcb41ed Compare August 12, 2023 09:42
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/providers/RecentMessagesApi.cpp Outdated Show resolved Hide resolved
src/providers/RecentMessagesApi.cpp Outdated Show resolved Hide resolved
@pajlada pajlada marked this pull request as ready for review August 12, 2023 10:55
@pajlada
Copy link
Member Author

pajlada commented Aug 12, 2023

image

@pajlada pajlada enabled auto-merge (squash) August 12, 2023 11:32
@pajlada pajlada merged commit 3e1e400 into master Aug 12, 2023
15 of 16 checks passed
@pajlada pajlada deleted the chore/refactor-recent-messages-api branch August 12, 2023 11:35
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions


using namespace recentmessages::detail;

void load(const QString &channelName, std::weak_ptr<Channel> channelPtr,
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'channelPtr' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
void load(const QString &channelName, std::weak_ptr<Channel> channelPtr,
void load(const QString &channelName, const std::weak_ptr<Channel>& channelPtr,

src/providers/recentmessages/Api.hpp:31:

- void load(const QString &channelName, std::weak_ptr<Channel> channelPtr,
+ void load(const QString &channelName, const std::weak_ptr<Channel>& channelPtr,

using namespace recentmessages::detail;

void load(const QString &channelName, std::weak_ptr<Channel> channelPtr,
ResultCallback onLoaded, ErrorCallback onError)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'onLoaded' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
ResultCallback onLoaded, ErrorCallback onError)
const ResultCallback& onLoaded, ErrorCallback onError)

src/providers/recentmessages/Api.hpp:32:

-           ResultCallback onLoaded, ErrorCallback onError);
+           const ResultCallback& onLoaded, ErrorCallback onError);

using namespace recentmessages::detail;

void load(const QString &channelName, std::weak_ptr<Channel> channelPtr,
ResultCallback onLoaded, ErrorCallback onError)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'onError' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
ResultCallback onLoaded, ErrorCallback onError)
ResultCallback onLoaded, const ErrorCallback& onError)

src/providers/recentmessages/Api.hpp:32:

-           ResultCallback onLoaded, ErrorCallback onError);
+           ResultCallback onLoaded, const ErrorCallback& onError);

Nerixyz pushed a commit to Nerixyz/chatterino2 that referenced this pull request Aug 12, 2023
This exposes internal functions for testing by splitting the implementation & internal API into separate files
Nerixyz pushed a commit to Nerixyz/chatterino2 that referenced this pull request Aug 19, 2023
This exposes internal functions for testing by splitting the implementation & internal API into separate files
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