summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2005-07-13 00:21:13 +0000
committerDave Mitchell <davem@fdisolutions.com>2005-07-13 00:21:13 +0000
commit041457d90dbb6fb79a72c7a8462f01423f2daa09 (patch)
tree5393e1e2a48eb57f050aa85b76a30b7f9f198257 /perlio.c
parente352bcff231c07cf21f07ae801f374a3da3229ed (diff)
downloadperl-041457d90dbb6fb79a72c7a8462f01423f2daa09.tar.gz
make the expensive ckWARN() be called as late as possible
reorganise if (ckWARN(FOO) && should_not_happen_condition) to if (should_not_happen_condition && ckWARN(FOO)) p4raw-id: //depot/perl@25129
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/perlio.c b/perlio.c
index 2276f4c339..9cd24d2bf9 100644
--- a/perlio.c
+++ b/perlio.c
@@ -979,7 +979,6 @@ PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names)
}
}
if (e > s) {
- const bool warn_layer = ckWARN(WARN_LAYER);
PerlIO_funcs *layer =
PerlIO_find_layer(aTHX_ s, llen, 1);
if (layer) {
@@ -989,7 +988,7 @@ PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names)
&PL_sv_undef);
}
else {
- if (warn_layer)
+ if (ckWARN(WARN_LAYER))
Perl_warner(aTHX_ packWARN(WARN_LAYER), "Unknown PerlIO layer \"%.*s\"",
(int) llen, s);
return -1;