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)
HE *he;
SV *val;
-#if defined(UNDER_CE)
-/*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)) &&