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

add empty() for cpr::Cookies #1046

Merged
merged 3 commits into from
Apr 29, 2024
Merged

Conversation

xiaoloudongfeng
Copy link
Contributor

No description provided.

Copy link
Member

@COM8 COM8 left a comment

Choose a reason for hiding this comment

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

@xiaoloudongfeng thanks! Please make it const and we are ready to go.

cpr/cookies.cpp Outdated
@@ -100,6 +100,10 @@ void Cookies::emplace_back(const Cookie& str) {
cookies_.emplace_back(str);
}

bool Cookies::empty() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
bool Cookies::empty() {
bool Cookies::empty() const {

I would suggest making it const.

@@ -80,6 +80,7 @@ class Cookies {
const_iterator cbegin() const;
const_iterator cend() const;
void emplace_back(const Cookie& str);
bool empty();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
bool empty();
[[nodiscard]] bool empty() const;

@xiaoloudongfeng
Copy link
Contributor Author

@COM8 sorry I was careless, it has been fixed

Copy link
Member

@COM8 COM8 left a comment

Choose a reason for hiding this comment

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

Thanks!

@COM8 COM8 merged commit 7cd69d2 into libcpr:master Apr 29, 2024
@xiaoloudongfeng xiaoloudongfeng deleted the empty-for-cookies branch May 1, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants