summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2017-09-08 11:21:58 +0200
committerLukas Mai <l.mai@web.de>2017-09-08 11:21:58 +0200
commitae59d0fba73f3a4b9f082a26fad09e6cb2553dd2 (patch)
treef99e2b28d3e630c7e4ff90347ef2b154ce4f0a3c /toke.c
parent14795193793753d71ffd287b58817b8fa0d8be76 (diff)
downloadperl-ae59d0fba73f3a4b9f082a26fad09e6cb2553dd2.tar.gz
simplify s///eee lexing logic
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/toke.c b/toke.c
index 4f370895c0..8b5f8628d5 100644
--- a/toke.c
+++ b/toke.c
@@ -9721,18 +9721,14 @@ S_scan_subst(pTHX_ char *start)
PL_multi_end = 0;
pm->op_pmflags |= PMf_EVAL;
- while (es-- > 0) {
- if (es)
- sv_catpvs(repl, "eval ");
- else
- sv_catpvs(repl, "do ");
- }
- sv_catpvs(repl, "{");
+ for (; es > 1; es--) {
+ sv_catpvs(repl, "eval ");
+ }
+ sv_catpvs(repl, "do {");
sv_catsv(repl, PL_parser->lex_sub_repl);
sv_catpvs(repl, "}");
SvREFCNT_dec(PL_parser->lex_sub_repl);
PL_parser->lex_sub_repl = repl;
- es = 1;
}