diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-10-19 15:23:03 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-10-19 15:23:03 +0100 |
| commit | 21a3e39ce5b2b833d147b529c0276f1e27398e0a (patch) | |
| tree | d38ec54ab52935b2f4ea923ad7ee40c5dc91865b /src | |
| parent | 502fc9e8c1009549780f98a06188ad36824c4252 (diff) | |
| download | rabbitmq-server-git-21a3e39ce5b2b833d147b529c0276f1e27398e0a.tar.gz | |
3) Cache results of rabbit_registry:lookup_module() for exchange types in the process dictionary.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_exchange.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index b96a2bc824..e1e7245f2d 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -358,5 +358,9 @@ peek_serial(XName) -> %% Used with atoms from records; e.g., the type is expected to exist. type_to_module(T) -> - {ok, Module} = rabbit_registry:lookup_module(exchange, T), - Module. + case get({xtype_to_module, T}) of + undefined -> {ok, Module} = rabbit_registry:lookup_module(exchange, T), + put({xtype_to_module, T}, Module), + Module; + Module -> Module + end. |
