Explorar el Código

idna: add fast path for ASCII characters to bidi classification

Dirkjan Ochtman hace 6 años
padre
commit
cb099d7588
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      idna/src/uts46.rs

+ 3 - 0
idna/src/uts46.rs

@@ -535,6 +535,9 @@ impl fmt::Display for Error {
 
 fn is_bidi_domain(s: &str) -> bool {
     for c in s.chars() {
+        if c.is_ascii_graphic() {
+            continue;
+        }
         match bidi_class(c) {
             BidiClass::R | BidiClass::AL | BidiClass::AN => return true,
             _ => {}