From 597ac00593cb7674c29dde36454746861b7bc1ff Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 10 Nov 2003 09:52:28 +0000 Subject: new warning: you can replace "member($xxx, keys %yyy)" with "exists $yyy{$xxx}" --- perl_checker.src/parser_helper.ml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'perl_checker.src') diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index 5a48a10..ac0223c 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -810,6 +810,13 @@ let call_raw is_a_func (e, para) = | Anonymous_sub _ :: _ -> () | _ -> warn_rule (sprintf "always use \"%s\" with a block (eg: %s { ... } @list)" f f)); None + + | "member" -> + (match para with + [ List [ _; Call(Deref(I_func, Ident(None, "keys", _)), _) ] ] -> + warn_rule "you can replace \"member($xxx, keys %yyy)\" with \"exists $yyy{$xxx}\"" + | _ -> ()); + None | _ -> None in Call(e, some_or para' para) -- cgit v1.2.1