Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Removal of a redundant test in sv.c #13710

Closed
p5pRT opened this issue Apr 4, 2014 · 6 comments
Closed

[PATCH] Removal of a redundant test in sv.c #13710

p5pRT opened this issue Apr 4, 2014 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 4, 2014

Migrated from rt.perl.org#121580 (status was 'resolved')

Searchable as RT121580$

@p5pRT
Copy link
Author

p5pRT commented Apr 4, 2014

From bogossian@mail.com

Removal of a useless if(...), redundant with the condition of the for(...) the line juste above.
A patch generated by git is in attachment.

@p5pRT
Copy link
Author

p5pRT commented Apr 4, 2014

From bogossian@mail.com

0001-Remove-redundant-test.patch
From 288aa38abe59fc3133ff907ed5a827e8e359763c Mon Sep 17 00:00:00 2001
From: Pierre Bogossian <bogossian@mail.com>
Date: Fri, 4 Apr 2014 20:07:56 +0200
Subject: [PATCH] Remove redundant test
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.10.4"

This is a multi-part message in MIME format.
--------------1.7.10.4
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

---
 sv.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)


--------------1.7.10.4
Content-Type: text/x-patch; name="0001-Remove-redundant-test.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Remove-redundant-test.patch"

diff --git a/sv.c b/sv.c
index 087606b..6399598 100644
--- a/sv.c
+++ b/sv.c
@@ -14834,15 +14834,14 @@ S_find_uninit_var(pTHX_ const OP *const obase, const SV *const uninit_sv,
 	 */
 	o2 = NULL;
 	for (kid=o; kid; kid = kid->op_sibling) {
-	    if (kid) {
-		const OPCODE type = kid->op_type;
-		if ( (type == OP_CONST && SvOK(cSVOPx_sv(kid)))
-		  || (type == OP_NULL  && ! (kid->op_flags & OPf_KIDS))
-		  || (type == OP_PUSHMARK)
-		  || (type == OP_PADRANGE)
-		)
-		continue;
-	    }
+	    const OPCODE type = kid->op_type;
+	    if ( (type == OP_CONST && SvOK(cSVOPx_sv(kid)))
+	      || (type == OP_NULL  && ! (kid->op_flags & OPf_KIDS))
+	      || (type == OP_PUSHMARK)
+	      || (type == OP_PADRANGE)
+	    )
+	    continue;
+
 	    if (o2) { /* more than one found */
 		o2 = NULL;
 		break;

--------------1.7.10.4--


@p5pRT
Copy link
Author

p5pRT commented Apr 14, 2014

From @tonycoz

On Fri Apr 04 11​:25​:32 2014, bogossian@​mail.com wrote​:

Removal of a useless if(...), redundant with the condition of the
for(...) the line juste above.
A patch generated by git is in attachment.

This looks sane to me, blead is in a release freeze, I've added it to the 5.21.1 release blockers list.

Tony

@p5pRT
Copy link
Author

p5pRT commented Apr 14, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 28, 2014

From @tonycoz

On Fri Apr 04 11​:25​:32 2014, bogossian@​mail.com wrote​:

Removal of a useless if(...), redundant with the condition of the
for(...) the line juste above.
A patch generated by git is in attachment.

Thanks, applied as f8bd1ec and added you to AUTHORS in f4c6aaa.

Tony

@p5pRT p5pRT closed this as completed May 28, 2014
@p5pRT
Copy link
Author

p5pRT commented May 28, 2014

@tonycoz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant