This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
simply 'use bytes' handling of (??{})
authorDavid Mitchell <davem@iabyn.com>
Sun, 3 Jun 2012 18:21:43 +0000 (19:21 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:32:55 +0000 (13:32 +0100)
make it slightly more readable without changing code logic.

regexec.c

index ffd107c..1ae61c3 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -4450,14 +4450,9 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
                        U32 pm_flags = 0;
                        const I32 osize = PL_regsize;
 
-                       if (DO_UTF8(ret)) {
-                           assert (SvUTF8(ret));
-                       } else if (SvUTF8(ret)) {
-                           /* Not doing UTF-8, despite what the SV says. Is
-                              this only if we're trapped in use 'bytes'?  */
-                           /* Make a copy of the octet sequence, but without
-                              the flag on, as the compiler now honours the
-                              SvUTF8 flag on ret.  */
+                       if (SvUTF8(ret) && IN_BYTES) {
+                           /* In use 'bytes': make a copy of the octet
+                            * sequence, but without the flag on */
                            STRLEN len;
                            const char *const p = SvPV(ret, len);
                            ret = newSVpvn_flags(p, len, SVs_TEMP);