summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-12-28 22:29:25 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2012-12-28 22:29:25 +0000
commit47ed99009df40ab6e41e9fe23d0663a0447c17d9 (patch)
treeceb335d890e1b39dbacf3dc9ee7825b9c14aeb32
parentf2a3b0b709583065dfa46c8bc1c88bcff79ab775 (diff)
downloadrabbitmq-server-git-47ed99009df40ab6e41e9fe23d0663a0447c17d9.tar.gz
optimisation: ditch guards on rabbit_misc:r/{2,3}
-rw-r--r--src/rabbit_misc.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 4efde50ec5..edaa719899 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -352,13 +352,12 @@ set_table_value(Table, Key, Type, Value) ->
sort_field_table(
lists:keystore(Key, 1, Table, {Key, Type, Value})).
-r(#resource{virtual_host = VHostPath}, Kind, Name)
- when is_binary(Name) ->
+r(#resource{virtual_host = VHostPath}, Kind, Name) ->
#resource{virtual_host = VHostPath, kind = Kind, name = Name};
-r(VHostPath, Kind, Name) when is_binary(Name) andalso is_binary(VHostPath) ->
+r(VHostPath, Kind, Name) ->
#resource{virtual_host = VHostPath, kind = Kind, name = Name}.
-r(VHostPath, Kind) when is_binary(VHostPath) ->
+r(VHostPath, Kind) ->
#resource{virtual_host = VHostPath, kind = Kind, name = '_'}.
r_arg(#resource{virtual_host = VHostPath}, Kind, Table, Key) ->