diff options
author | Vlad Ionescu <vlad@lshift.net> | 2009-09-17 13:49:11 +0100 |
---|---|---|
committer | Vlad Ionescu <vlad@lshift.net> | 2009-09-17 13:49:11 +0100 |
commit | 239291cc0300fcae297caa7bdd2f5ebb20fb226f (patch) | |
tree | 218134a4e477f0c2d6a8321a23015863f40b9ec4 | |
parent | 547ccadbe16baa714f8fdaa45cb0dcd21db93954 (diff) | |
download | rabbitmq-server-239291cc0300fcae297caa7bdd2f5ebb20fb226f.tar.gz |
changing back a few usages of proplists:* to lists:key*; changing usages of proplists:lookup to proplists:get_value
-rw-r--r-- | src/rabbit_control.erl | 4 | ||||
-rw-r--r-- | src/rabbit_misc.erl | 6 | ||||
-rw-r--r-- | src/rabbit_multi.erl | 16 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index e05b1886..ed1d384d 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -326,8 +326,8 @@ display_row(Row) -> io:nl(). format_info_item(Key, Items) -> - Info = {Key, Value} = proplists:lookup(Key, Items), - case Info of + Value = proplists:get_value(Key, Items), + case {Key, Value} of {_, #resource{name = Name}} -> escape(Name); _ when Key =:= address; Key =:= peer_address andalso is_tuple(Value) -> diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 814e3c31..95a274e3 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -189,9 +189,9 @@ r(VHostPath, Kind) when is_binary(VHostPath) -> r_arg(#resource{virtual_host = VHostPath}, Kind, Table, Key) -> r_arg(VHostPath, Kind, Table, Key); r_arg(VHostPath, Kind, Table, Key) -> - case proplists:lookup(Key, Table) of - {_, longstr, NameBin} -> r(VHostPath, Kind, NameBin); - none -> undefined + case lists:keysearch(Key, 1, Table) of + {value, {_, longstr, NameBin}} -> r(VHostPath, Kind, NameBin); + false -> undefined end. rs(#resource{virtual_host = VHostPath, kind = Kind, name = Name}) -> diff --git a/src/rabbit_multi.erl b/src/rabbit_multi.erl index 6fc7bd67..35b1def3 100644 --- a/src/rabbit_multi.erl +++ b/src/rabbit_multi.erl @@ -217,19 +217,19 @@ is_rabbit_running(Node, RpcTimeout) -> {badrpc, _} -> false; Status -> - case proplists:lookup(running_applications, Status) of - {running_applications, Apps} -> - proplists:is_defined(rabbit, Apps); - none -> - false + case proplists:get_value(running_applications, Status) of + undefined -> + false; + Apps -> + lists:keymember(rabbit, 1, Apps) end end. with_os(Handlers) -> {OsFamily, _} = os:type(), - case proplists:lookup(OsFamily, Handlers) of - {_, Handler} -> Handler(); - none -> throw({unsupported_os, OsFamily}) + case proplists:get_value(OsFamily, Handlers) of + Handler -> Handler(); + undefined -> throw({unsupported_os, OsFamily}) end. script_filename() -> |