diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-10-19 15:43:32 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-10-19 15:43:32 +0100 |
commit | 2b860bbe1ce26a77bc53284b2d8e69354ebf03be (patch) | |
tree | b9c8eb63506a2c2abb0a769fd6c0b075475d78dd | |
parent | 59aec8cca3cbbfb822e5931c7a355c7c4a5a7c6e (diff) | |
download | rabbitmq-server-2b860bbe1ce26a77bc53284b2d8e69354ebf03be.tar.gz |
Revert 910c670238ad (Produce guids a bit more efficiently)
-rw-r--r-- | src/rabbit_guid.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rabbit_guid.erl b/src/rabbit_guid.erl index 8cc80df4..cf3fea1a 100644 --- a/src/rabbit_guid.erl +++ b/src/rabbit_guid.erl @@ -80,13 +80,13 @@ guid() -> %% includes the node name) uniquely identifies a process in space %% and time. We combine that with a process-local counter to give %% us a GUID. - {S, I} = case get(guid) of - undefined -> S0 = gen_server:call(?SERVER, serial, infinity), - {erlang:md5(term_to_binary({S0, self()})), 0}; - {S0, I0} -> {S0, I0 + 1} - end, - put(guid, {S, I}), - <<S/binary, I:64>>. + G = case get(guid) of + undefined -> {{gen_server:call(?SERVER, serial, infinity), self()}, + 0}; + {S, I} -> {S, I+1} + end, + put(guid, G), + erlang:md5(term_to_binary(G)). %% generate a readable string representation of a GUID. string_guid(Prefix) -> |