Permalink
Browse files

Use lists:keysearch/3 instead of lists:keyfind/3.

Some erlang distributions (R12B and below) doesn't have lists:keyfind/3
function. It's better to use lists:keysearch/3 instead - it's available
everywhere.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
  • Loading branch information...
1 parent de57ba7 commit 83e9d611bbb683b0484c998580afa8374fcbdf84 @lemenkov committed May 22, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gen_leader.erl
View
@@ -1443,8 +1443,8 @@ mon_handle_req({monitor, P}, From, Refs) ->
{_Name, N} -> N;
Pid when is_pid(Pid) -> node(Pid)
end,
- case lists:keyfind(Node, 2, Refs) of
- {_, Ref} ->
+ case lists:keysearch(Node, 2, Refs) of
+ {value, {_, Ref}} ->
mon_reply(From, {Ref,Node}),
Refs;
false ->

0 comments on commit 83e9d61

Please sign in to comment.