summaryrefslogtreecommitdiff
path: root/pp_hot.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 /pp_hot.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 'pp_hot.c')
-rw-r--r--pp_hot.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pp_hot.c b/pp_hot.c
index b4b73ad566..07eb58553c 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1494,8 +1494,9 @@ Perl_do_readline(pTHX)
}
}
if (!fp) {
- if (ckWARN2(WARN_GLOB, WARN_CLOSED)
- && (!io || !(IoFLAGS(io) & IOf_START))) {
+ if ((!io || !(IoFLAGS(io) & IOf_START))
+ && ckWARN2(WARN_GLOB, WARN_CLOSED))
+ {
if (type == OP_GLOB)
Perl_warner(aTHX_ packWARN(WARN_GLOB),
"glob failed (can't start child: %s)",
@@ -1610,8 +1611,8 @@ Perl_do_readline(pTHX)
const STRLEN len = SvCUR(sv) - offset;
const U8 *f;
- if (ckWARN(WARN_UTF8) &&
- !Perl_is_utf8_string_loc(aTHX_ s, len, &f))
+ if (!Perl_is_utf8_string_loc(aTHX_ s, len, &f)
+ && ckWARN(WARN_UTF8))
/* Emulate :encoding(utf8) warning in the same case. */
Perl_warner(aTHX_ packWARN(WARN_UTF8),
"utf8 \"\\x%02X\" does not map to Unicode",