diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2012-12-28 22:29:25 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-12-28 22:29:25 +0000 |
| commit | 47ed99009df40ab6e41e9fe23d0663a0447c17d9 (patch) | |
| tree | ceb335d890e1b39dbacf3dc9ee7825b9c14aeb32 | |
| parent | f2a3b0b709583065dfa46c8bc1c88bcff79ab775 (diff) | |
| download | rabbitmq-server-git-47ed99009df40ab6e41e9fe23d0663a0447c17d9.tar.gz | |
optimisation: ditch guards on rabbit_misc:r/{2,3}
| -rw-r--r-- | src/rabbit_misc.erl | 7 |
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) -> |
