diff options
author | Magnus Lång <[email protected]> | 2016-03-10 15:48:57 +0100 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2016-03-10 15:48:57 +0100 |
commit | a6fa6f54bb508da8c92b597a56acbb866abf2f0b (patch) | |
tree | 6507c97ea3f8cfeaafed2204dc993f1427f842af /lib/hipe/icode | |
parent | e86a36d19b8e7e84b66588c37714e6e57a8309a7 (diff) | |
download | otp-a6fa6f54bb508da8c92b597a56acbb866abf2f0b.tar.gz otp-a6fa6f54bb508da8c92b597a56acbb866abf2f0b.tar.bz2 otp-a6fa6f54bb508da8c92b597a56acbb866abf2f0b.zip |
hipe_icode_fp: simplify match/2
Diffstat (limited to 'lib/hipe/icode')
-rw-r--r-- | lib/hipe/icode/hipe_icode_fp.erl | 14 |
1 files 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. |