This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove duplicate code from pp_study(), caused by a4f4e9060b702ac8.
authorNicholas Clark <nick@ccl4.org>
Thu, 19 May 2011 10:07:29 +0000 (11:07 +0100)
committerNicholas Clark <nick@ccl4.org>
Thu, 19 May 2011 10:07:29 +0000 (11:07 +0100)
The duplicated code could have had no effect - for the case of pos <= 0
pp_study had already returned NO. The second call to SvPV() would have had no
side effects, because scalars with side effects don't have SvPOK() true, so
would also have already returned NO.

pp.c

diff --git a/pp.c b/pp.c
index 3cfbe1a..9579503 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -728,10 +728,6 @@ PP(pp_study)
     }
     PL_lastscream = SvREFCNT_inc_simple(sv);
 
-    s = (unsigned char*)(SvPV(sv, len));
-    pos = len;
-    if (pos <= 0)
-       RETPUSHNO;
     if (pos > PL_maxscream) {
        if (PL_maxscream < 0) {
            PL_maxscream = pos + 80;