mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
code simplification (#1244)
Based on #1242, I don't think this is required but it does remove that issue and checking on compiler explore it does simplify the generated code. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -165,14 +165,12 @@ CLI11_INLINE bool valid_name_string(const std::string &str);
|
||||
|
||||
/// Verify an app name
|
||||
inline bool valid_alias_name_string(const std::string &str) {
|
||||
static const std::string badChars{'\n', '\0'};
|
||||
return (str.find_first_of(badChars) == std::string::npos);
|
||||
return ((str.find_first_of('\n') == std::string::npos) && (str.find_first_of('\0') == std::string::npos));
|
||||
}
|
||||
|
||||
/// check if a string is a container segment separator (empty or "%%")
|
||||
inline bool is_separator(const std::string &str) {
|
||||
static const std::string sep("%%");
|
||||
return (str.empty() || str == sep);
|
||||
return (str.empty() || (str.size() == 2 && str[0] == '%' && str[1] == '%'));
|
||||
}
|
||||
|
||||
/// Verify that str consists of letters only
|
||||
|
||||
Reference in New Issue
Block a user