This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
doop.c: Change name of variable
authorKarl Williamson <khw@cpan.org>
Mon, 4 Nov 2019 21:17:09 +0000 (14:17 -0700)
committerKarl Williamson <khw@cpan.org>
Thu, 7 Nov 2019 04:22:24 +0000 (21:22 -0700)
This helped me understand what was going on in this function

doop.c

diff --git a/doop.c b/doop.c
index 0fa9103..bd7b7c5 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -175,14 +175,14 @@ S_do_trans_complex(pTHX_ SV * const sv, const OPtrans_map * const tbl)
        if (PL_op->op_private & OPpTRANS_SQUASH) {
            const U8* p = send;
            while (s < send) {
-               const short ch = tbl->map[*s];
-               if (ch >= 0) {
-                   *d = (U8)ch;
+               const short this_map = tbl->map[*s];
+               if (this_map >= 0) {
+                   *d = (U8)this_map;
                    matches++;
                    if (p != d - 1 || *p != *d)
                        p = d++;
                }
-               else if (ch == (short) TR_UNMAPPED)
+               else if (this_map == (short) TR_UNMAPPED)
                    *d++ = *s;
                else if (ch == (short) TR_DELETE)
                    matches++;
@@ -191,14 +191,14 @@ S_do_trans_complex(pTHX_ SV * const sv, const OPtrans_map * const tbl)
        }
        else {  /* Not to squash */
            while (s < send) {
-               const short ch = tbl->map[*s];
-               if (ch >= 0) {
+               const short this_map = tbl->map[*s];
+               if (this_map >= 0) {
                    matches++;
-                   *d++ = (U8)ch;
+                   *d++ = (U8)this_map;
                }
-               else if (ch == (short) TR_UNMAPPED)
+               else if (this_map == (short) TR_UNMAPPED)
                    *d++ = *s;
-               else if (ch == (short) TR_DELETE)
+               else if (this_map == (short) TR_DELETE)
                    matches++;
                s++;
            }