Commits

Bryan O'Sullivan committed 1a803ee

encodeUtf8_2: fix parallel range check

This makes it rather expensive, alas.

Comments (0)

Files changed (1)

       *dest++ = c;
       *dest++ = d;
     }
-    else if ((w & 0xF800F800F800F800ULL) == 0) {
+    else if (!(w & 0xF800F800F800F800ULL) && (w & 0xFF80000000000000ULL) &&
+	     (w & 0x0000FF8000000000ULL) && (w & 0x00000000FF800000ULL) &&
+	     (w & 0x000000000000FF80ULL)) {
       *dest++ = (a >> 6) | 0xC0;
       *dest++ = (a & 0x3f) | 0x80;
       *dest++ = (b >> 6) | 0xC0;
       *dest++ = a;
       *dest++ = b;
     }
-    else if ((w & 0xF800F800) == 0) {
+    else if (!(w & 0xF800F800) && (w & 0xFF800000) && (w & 0x0000FF80)) {
       *dest++ = (a >> 6) | 0xC0;
       *dest++ = (a & 0x3f) | 0x80;
       *dest++ = (b >> 6) | 0xC0;