summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-03-27 20:55:53 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2012-03-27 20:55:53 +0100
commit2d2df7c9e73d92713128ff717c7af8c07288781c (patch)
tree32473b4b0bf5ac6a1a3cc6b9ea822706b9b75fbc
parent12591b3a45130abeccaed3cf9facdf89cd042e06 (diff)
downloadrabbitmq-server-2d2df7c9e73d92713128ff717c7af8c07288781c.tar.gz
cosmetic: don't rely on Erlang term order to catch type errors
-rw-r--r--src/rabbit_amqqueue.erl11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index c2724a12..87a7e7e4 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -355,13 +355,12 @@ check_string_argument({Type, _}, _) ->
check_integer_argument(undefined, _Args) ->
ok;
-check_integer_argument({Type, Val}, _Args) when Val > 0 ->
+check_integer_argument({Type, Val}, _Args) ->
case lists:member(Type, ?INTEGER_ARG_TYPES) of
- true -> ok;
- false -> {error, {unacceptable_type, Type}}
- end;
-check_integer_argument({_Type, Val}, _Args) ->
- {error, {value_zero_or_less, Val}}.
+ false -> {error, {unacceptable_type, Type}};
+ true when Val =< 0 -> {error, {value_zero_or_less, Val}};
+ true -> ok
+ end.
check_dlxrk_argument(undefined, _Args) ->
ok;