summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-09-10 14:16:06 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-09-10 14:16:06 +0100
commit319a486d11bb1cc1ea1a3c86933e467fb7f39173 (patch)
tree8cc691bd28fea1d824308a96168d1f5a2df70ded
parentd4b6f7f3ca063ea4192a6cbb3ae5e107f9ad9d8a (diff)
downloadrabbitmq-server-git-319a486d11bb1cc1ea1a3c86933e467fb7f39173.tar.gz
Simplify
-rw-r--r--src/rabbit_policy.erl7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/rabbit_policy.erl b/src/rabbit_policy.erl
index 4eb7c2ba0b..69480c9c11 100644
--- a/src/rabbit_policy.erl
+++ b/src/rabbit_policy.erl
@@ -129,12 +129,7 @@ match(Name, Policies) ->
end.
matches(#resource{name = Name}, Policy) ->
- case re:run(binary_to_list(Name),
- binary_to_list(pget(<<"pattern">>, Policy)),
- [{capture, none}]) of
- nomatch -> false;
- match -> true
- end.
+ match =:= re:run(Name, pget(<<"pattern">>, Policy), [{capture, none}]).
sort_pred(A, B) ->
pget(<<"priority">>, A, 0) >= pget(<<"priority">>, B, 0).