Integrate perlio:
[p5sagit/p5-mst-13.2.git] / utf8.c
diff --git a/utf8.c b/utf8.c
index 472a89f..7ee3859 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -237,9 +237,17 @@ Perl_is_utf8_string(pTHX_ U8 *s, STRLEN len)
     send = s + len;
 
     while (x < send) {
-        c = is_utf8_char(x);
-       if (!c)
-           return FALSE;
+        /* Inline the easy bits of is_utf8_char() here for speed... */
+        if (UTF8_IS_INVARIANT(*x))
+             c = 1;
+        else if (!UTF8_IS_START(*x))
+             return FALSE;
+        else {
+             /* ... and call is_utf8_char() only if really needed. */
+             c = is_utf8_char(x);
+             if (!c)
+                  return FALSE;
+        }
         x += c;
     }
     if (x != send)
@@ -1348,15 +1356,6 @@ Perl_to_utf8_case(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, char *norma
         HE *he;
         SV *val;
        
-#if defined(UNDER_CE) && defined(MIPS)
-/*strange: compiler complaints that I redefine macro UVXf and points where
-           it was first defined. I copied line from there without any changes.
-           Nothing should change.
-           But when I do not do this, there is an error on a line with
-              Perl_newSVpvf(aTHX_ "%04"UVXf, uv1)
-*/
-#define        UVXf            "lX"            /**/
-#endif
         if ((hv    = get_hv(special, FALSE)) &&
             (keysv = sv_2mortal(Perl_newSVpvf(aTHX_ "%04"UVXf, uv1))) &&
             (he    = hv_fetch_ent(hv, keysv, FALSE, 0)) &&