From a6fa6f54bb508da8c92b597a56acbb866abf2f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Thu, 10 Mar 2016 15:48:57 +0100 Subject: hipe_icode_fp: simplify match/2 --- lib/hipe/icode/hipe_icode_fp.erl | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/hipe/icode/hipe_icode_fp.erl b/lib/hipe/icode/hipe_icode_fp.erl index 4f404d458c..ae12f20cc2 100644 --- a/lib/hipe/icode/hipe_icode_fp.erl +++ b/lib/hipe/icode/hipe_icode_fp.erl @@ -1192,15 +1192,5 @@ add_work(WorkList, []) -> -spec match(var_map(), var_map()) -> boolean(). -match(Tree1, Tree2) -> - match_1(maps:to_list(Tree1), Tree2) andalso - match_1(maps:to_list(Tree2), Tree1). - -match_1([{Key, Val}|Left], Tree2) -> - case Tree2 of - #{Key := Val} -> - match_1(Left, Tree2); - #{} -> false - end; -match_1([], _) -> - true. +match(Tree1, Tree2) when is_map(Tree1), is_map(Tree2) -> + Tree1 =:= Tree2. -- cgit v1.2.3