This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
src/System.Private.Uri/src/System Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -788,20 +788,16 @@ internal static bool IsLWS(char ch)
788788 return ( ch <= ' ') && ( ch == ' ' || ch == '\n ' || ch == '\r ' || ch == '\t ') ;
789789 }
790790
791- //Only consider ASCII characters
792791 internal static bool IsAsciiLetter( char character) =>
793- ( ( uint ) ( character - 'a') <= 'z' - 'a') ||
794- ( ( uint ) ( character - 'A') <= 'Z' - 'A') ;
792+ ( ( ( uint ) character - 'A') & ~ 0x20 ) < 26 ;
795793
796794 internal static bool IsAsciiLetterOrDigit( char character) =>
797- ( ( uint ) ( character - 'a') <= 'z' - 'a') ||
798- ( ( uint ) ( character - 'A') <= 'Z' - 'A') ||
799- ( ( uint ) ( character - '0 ') <= '9 ' - '0 ') ;
795+ ( ( ( ( uint ) character - 'A') & ~ 0x20 ) < 26 ) ||
796+ ( ( ( uint ) character - '0 ') < 10 ) ;
800797
801798 internal static bool IsHexDigit( char character) =>
802- ( ( uint ) ( character - 'A') <= 'F' - 'A') ||
803- ( ( uint ) ( character - 'a') <= 'f' - 'a') ||
804- ( ( uint ) ( character - '0 ') <= '9 ' - '0 ') ;
799+ ( ( ( ( uint ) character - 'A') & ~ 0x20 ) < 6 ) ||
800+ ( ( ( uint ) character - '0 ') < 10 ) ;
805801
806802 //
807803 // Is this a Bidirectional control char.. These get stripped
You can’t perform that action at this time.
0 commit comments