summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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).