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

cleanup: Changes for c++17 #1376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

stickz
Copy link
Contributor

@stickz stickz commented Jan 15, 2025

This cleanup adjusts the rTorrent code to comply with c++17 standard. It also simplifies various parts of the code.

This cleanup adjusts the rTorrent code to comply with c++17 standard. It also simplifies various parts of the code.
return c == '\n' || c == '\0' || c == ';';
}
};
bool command_map_is_space(char c) {
Copy link
Owner

Choose a reason for hiding this comment

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

inline

@@ -150,7 +142,7 @@ parse_command(target_type target, const char* first, const char* last) {
// Find the last character that is part of this command, skipping
// the whitespace at the end. This ensures us that the caller
// doesn't need to do this nor check for junk at the end.
first = std::find_if(first, last, std::not1(command_map_is_space()));
first = std::find_if(first, last, [&](char c) { return !command_map_is_space(c); });

if (first != last) {
if (*first != '\n' && *first != ';' && *first != '\0')
Copy link
Owner

@rakshasa rakshasa Jan 16, 2025

Choose a reason for hiding this comment

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

This if statement should be !command_map_is_newline(*first), the function above you deleted.

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