diff options
author | Karl Williamson <khw@cpan.org> | 2014-08-26 08:36:31 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-09-03 12:43:15 -0600 |
commit | 2ab58e930a8796c192de074ed05261cc1616c779 (patch) | |
tree | 41dad439f18a46cfd53881acd47697994ac71168 /regcomp.c | |
parent | 93e92956bb470aeaf41fd87a47176cf4906ffd1c (diff) | |
download | perl-2ab58e930a8796c192de074ed05261cc1616c779.tar.gz |
regcomp.c: Swap if/else clauses
This makes it slightly easier to understand as there is no explicit
complement, but is mostly for a future commit.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -16697,7 +16697,13 @@ S_put_byte(pTHX_ SV *sv, int c) { PERL_ARGS_ASSERT_PUT_BYTE; - if (!isPRINT(c)) { + if (isPRINT(c)) { + const char string = c; + if (isBACKSLASHED_PUNCT(c)) + sv_catpvs(sv, "\\"); + sv_catpvn(sv, &string, 1); + } + else { switch (c) { case '\a': Perl_sv_catpvf(aTHX_ sv, "\\a"); break; case '\b': Perl_sv_catpvf(aTHX_ sv, "\\b"); break; @@ -16709,12 +16715,6 @@ S_put_byte(pTHX_ SV *sv, int c) default: Perl_sv_catpvf(aTHX_ sv, "\\x{%02X}", c); break; } } - else { - const char string = c; - if (isBACKSLASHED_PUNCT(c)) - sv_catpvs(sv, "\\"); - sv_catpvn(sv, &string, 1); - } } #define MAX_PRINT_A MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C |