Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Optimisation #51

Merged
merged 1 commit into from
Feb 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/rabbit_misc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,20 @@ is_process_alive(Pid) ->
lists:member(Node, [node() | nodes()]) andalso
rpc:call(Node, erlang, is_process_alive, [Pid]) =:= true.

pget(K, P) -> proplists:get_value(K, P).
pget(K, P, D) -> proplists:get_value(K, P, D).
pget(K, P) ->
case lists:keyfind(K, 1, P) of
{K, V} ->
V;
_ ->
undefined
end.
pget(K, P, D) ->
case lists:keyfind(K, 1, P) of
{K, V} ->
V;
_ ->
D
end.

pget_or_die(K, P) ->
case proplists:get_value(K, P) of
Expand Down