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
commitd30dda5a869a60b64c98adf11095b62c9baa3843 (patch)
tree8cc691bd28fea1d824308a96168d1f5a2df70ded
parent18e85807bee45cc33da857e047994ecfb79935da (diff)
downloadrabbitmq-server-bug25062.tar.gz
Simplifybug25062
-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 4eb7c2ba..69480c9c 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).