Skip to content

Commit

Permalink
regexec.c: Refactor switch default()
Browse files Browse the repository at this point in the history
It seems clearer to me to have the panic at the end of the routine
instead of as the default: of a switch().
  • Loading branch information
khwilliamson committed May 6, 2021
1 parent 7cb24dc commit 466d78f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion regexec.c
Expand Up @@ -462,9 +462,13 @@ S_isFOO_lc(pTHX_ const U8 classnum, const U8 character)
case CC_ENUM_WORDCHAR_: return isU8_WORDCHAR_LC(character);
case CC_ENUM_XDIGIT_: return isU8_XDIGIT_LC(character);
default: /* VERTSPACE should never occur in locales */
Perl_croak(aTHX_ "panic: isFOO_lc() has an unexpected character class '%d'", classnum);
break;
}

Perl_croak(aTHX_
"panic: isFOO_lc() has an unexpected character class '%d'",
classnum);

NOT_REACHED; /* NOTREACHED */
return FALSE;
}
Expand Down

0 comments on commit 466d78f

Please sign in to comment.