Skip to content

Commit f74260d

Browse files
chore: resolve ValidChar function lint/compile warnings (#234) (#242)
The argument to `ValidChar` is a `char`, so its max value is `255` rendering the check redundant. This causes a warning on our Mac compilations as well as a linter warning. Co-authored-by: Ryan Lamb <[email protected]>
1 parent 6876f69 commit f74260d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libs/common/src/config/app_info_builder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ tl::expected<std::string, Error> AppInfoBuilder::Tag::Build() const {
2121
}
2222

2323
bool ValidChar(char c) {
24-
if(c > 0 && c < 255) {
25-
// The MSVC implementation of isalnum will assert if the number it outside
26-
// its lookup table.
24+
if (c > 0) {
25+
// The MSVC implementation of isalnum will assert if the number is
26+
// outside its lookup table (0-0xFF, inclusive.)
2727
// iswalnum would not, but is less restrictive than desired.
2828
return std::isalnum(c) != 0 || c == '-' || c == '.' || c == '_';
2929
}

0 commit comments

Comments
 (0)