File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,6 @@ StringView to_string(component_type type) {
6161 return " " ;
6262}
6363
64- inline uint8_t bool2mask (bool x) { return x ? 0xFF : 0x00 ; }
65-
6664component_type component_replacement (StringView path) noexcept {
6765 // viable_components is a bitset of the component types not yet excluded
6866 std::uint8_t viable_components = all_components;
@@ -108,11 +106,14 @@ component_type component_replacement(StringView path) noexcept {
108106 }
109107
110108 // is_str requires a special char or a size >= 20
111- viable_components &= ~component_type::is_str |
112- bool2mask (found_special_char || (path.size () >= 20 ));
109+ if (!found_special_char && path.size () < 20 ) {
110+ viable_components &= ~component_type::is_str;
111+ }
112+
113113 // hex, and hex_id require a digit
114- viable_components &= ~(component_type::is_hex | component_type::is_hex_id) |
115- bool2mask (found_digit);
114+ if (!found_digit) {
115+ viable_components &= ~(component_type::is_hex | component_type::is_hex_id);
116+ }
116117
117118 if (viable_components == 0 ) {
118119 return component_type::none;
You can’t perform that action at this time.
0 commit comments