This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate empty conditional branch
authorJames E Keenan <jkeenan@cpan.org>
Fri, 23 Nov 2018 18:45:25 +0000 (13:45 -0500)
committerJames E Keenan <jkeenan@cpan.org>
Mon, 26 Nov 2018 01:57:08 +0000 (20:57 -0500)
Per:  https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2154840803

For: RT 133686 (partial)

sv.c

diff --git a/sv.c b/sv.c
index b10f205..826228b 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -5164,9 +5164,8 @@ S_sv_uncow(pTHX_ SV * const sv, const U32 flags)
                 SvCUR_set(sv, cur);
                 *SvEND(sv) = '\0';
             }
-           if (len) {
-           } else {
-               unshare_hek(SvSHARED_HEK_FROM_PV(pvx));
+           if (! len) {
+                       unshare_hek(SvSHARED_HEK_FROM_PV(pvx));
            }
 #ifdef DEBUGGING
             if (DEBUG_C_TEST)