From 5a13ba64777f14718ae20e4bca2a80f39304c367 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 31 Mar 2004 14:11:26 +0000 Subject: in "$a ? $a : xxx", "xxx" can need short circuit (even if i don't think any value which is_a_scalar can need_short_circuit) --- perl_checker.src/parser_helper.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index b95622e..a60cb79 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -431,7 +431,7 @@ let check_ternary_paras(cond, a, b) = in if dont_need_short_circuit a || is_same_fromparser cond a then check_ternary_para b; if dont_need_short_circuit b || is_same_fromparser cond b then check_ternary_para a; - if is_same_fromparser cond a && dont_need_short_circuit b && is_a_scalar a && is_a_scalar b then warn_rule "you can replace \"$foo ? $foo : $bar\" with \"$foo || $bar\""; + if is_same_fromparser cond a && is_a_scalar a && is_a_scalar b then warn_rule "you can replace \"$foo ? $foo : $bar\" with \"$foo || $bar\""; [ cond; a; b ] let check_unneeded_var_dollar_ esp = -- cgit v1.2.1