This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b7ad6c3
)
regcomp.c: Simplify expression
author
Karl Williamson
<khw@cpan.org>
Thu, 2 Mar 2017 04:52:22 +0000
(21:52 -0700)
committer
Karl Williamson
<khw@cpan.org>
Thu, 1 Jun 2017 14:30:24 +0000
(08:30 -0600)
Here, there is no advantage to assigning a variable within an 'if', and
it is somewhat harder to read, so don't do it.
regcomp.c
patch
|
blob
|
blame
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
6fc3716
..
97c5949
100644
(file)
--- a/
regcomp.c
+++ b/
regcomp.c
@@
-12017,7
+12017,8
@@
S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
RExC_parse++; /* Skip past the '{' */
- if (! (endbrace = strchr(RExC_parse, '}'))) { /* no trailing brace */
+ endbrace = strchr(RExC_parse, '}');
+ if (! endbrace) { /* no trailing brace */
vFAIL2("Missing right brace on \\%c{}", 'N');
}
else if(!(endbrace == RExC_parse /* nothing between the {} */