diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-03-31 14:11:26 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-03-31 14:11:26 +0000 |
commit | 5a13ba64777f14718ae20e4bca2a80f39304c367 (patch) | |
tree | e06833f4e6eee59bf456e115527fe46f51b9bf2d /perl_checker.src/parser_helper.ml | |
parent | 4cdf703757880d32272b5e904103ad9079fa5b03 (diff) | |
download | perl_checker-5a13ba64777f14718ae20e4bca2a80f39304c367.tar perl_checker-5a13ba64777f14718ae20e4bca2a80f39304c367.tar.gz perl_checker-5a13ba64777f14718ae20e4bca2a80f39304c367.tar.bz2 perl_checker-5a13ba64777f14718ae20e4bca2a80f39304c367.tar.xz perl_checker-5a13ba64777f14718ae20e4bca2a80f39304c367.zip |
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)
Diffstat (limited to 'perl_checker.src/parser_helper.ml')
-rw-r--r-- | perl_checker.src/parser_helper.ml | 2 |
1 files changed, 1 insertions, 1 deletions
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 = |