From d30dda5a869a60b64c98adf11095b62c9baa3843 Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Mon, 10 Sep 2012 14:16:06 +0100 Subject: Simplify --- src/rabbit_policy.erl | 7 +------ 1 file changed, 1 insertion(+), 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). -- cgit v1.2.1