From: Nicholas Clark Date: Fri, 3 Dec 2004 20:38:37 +0000 (+0000) Subject: Remove double checking of acceptable switches on tr/// ops. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a1e2023d90d879c7a6110f7be3e3c6e22bddc33;p=p5sagit%2Fp5-mst-13.2.git Remove double checking of acceptable switches on tr/// ops. p4raw-id: //depot/perl@23607 --- diff --git a/toke.c b/toke.c index 1b8de19..d79c123 100644 --- a/toke.c +++ b/toke.c @@ -6665,15 +6665,23 @@ S_scan_trans(pTHX_ char *start) } complement = del = squash = 0; - while (strchr("cds", *s)) { - if (*s == 'c') + while (1) { + switch (*s) { + case 'c': complement = OPpTRANS_COMPLEMENT; - else if (*s == 'd') + break; + case 'd': del = OPpTRANS_DELETE; - else if (*s == 's') + break; + case 's': squash = OPpTRANS_SQUASH; + break; + default: + goto no_more; + } s++; } + no_more: New(803, tbl, complement&&!del?258:256, short); o = newPVOP(OP_TRANS, 0, (char*)tbl);