summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-03-29 16:03:36 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2011-03-29 16:03:36 +0100
commit254a2dadf6814b782b7debfd1e3fe95f8e17739f (patch)
treed919b3fa746fab08f18f98874f2d717da13e4c8b
parent95ca5fddb6e4ff306580f2be8945353e52791282 (diff)
downloadrabbitmq-server-254a2dadf6814b782b7debfd1e3fe95f8e17739f.tar.gz
cosmetic
-rw-r--r--src/rabbit_control.erl27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index 8364ecd8..571eb5e4 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -382,12 +382,9 @@ rpc_call(Node, Mod, Fun, Args) ->
%% characters. We don't escape characters above 127, since they may
%% form part of UTF-8 strings.
-escape(Atom) when is_atom(Atom) ->
- escape(atom_to_list(Atom));
-escape(Bin) when is_binary(Bin) ->
- escape(binary_to_list(Bin));
-escape(L) when is_list(L) ->
- escape_char(lists:reverse(L), []).
+escape(Atom) when is_atom(Atom) -> escape(atom_to_list(Atom));
+escape(Bin) when is_binary(Bin) -> escape(binary_to_list(Bin));
+escape(L) when is_list(L) -> escape_char(lists:reverse(L), []).
escape_char([$\\ | T], Acc) ->
escape_char(T, [$\\, $\\ | Acc]);
@@ -402,19 +399,15 @@ escape_char([], Acc) ->
prettify_amqp_table(Table) ->
[{escape(K), prettify_typed_amqp_value(T, V)} || {K, T, V} <- Table].
-prettify_typed_amqp_value(Type, Value) ->
- case Type of
- longstr -> escape(Value);
- table -> prettify_amqp_table(Value);
- array -> [prettify_typed_amqp_value(T, V) || {T, V} <- Value];
- _ -> Value
- end.
+prettify_typed_amqp_value(longstr, Value) -> escape(Value);
+prettify_typed_amqp_value(table, Value) -> prettify_amqp_table(Value);
+prettify_typed_amqp_value(array, Value) -> [prettify_typed_amqp_value(T, V) ||
+ {T, V} <- Value];
+prettify_typed_amqp_value(_Type, Value) -> Value.
%% the slower shutdown on windows required to flush stdout
quit(Status) ->
case os:type() of
- {unix, _} ->
- halt(Status);
- {win32, _} ->
- init:stop(Status)
+ {unix, _} -> halt(Status);
+ {win32, _} -> init:stop(Status)
end.