diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2011-09-30 23:18:56 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-09-30 23:18:56 +0100 |
| commit | 1bb4234ec2e6f5e0f82531f98728a6fb3f0aed58 (patch) | |
| tree | f32157c1ea1f3f22699379a4892be7c80fc03cfa /src | |
| parent | e1eed03eecce965ac932f218b62c6ac801eb73d0 (diff) | |
| download | rabbitmq-server-git-1bb4234ec2e6f5e0f82531f98728a6fb3f0aed58.tar.gz | |
a few minor tweaks, essentially cosmetic
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_binary_generator.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rabbit_binary_generator.erl b/src/rabbit_binary_generator.erl index 75d7edf463..494f3203c8 100644 --- a/src/rabbit_binary_generator.erl +++ b/src/rabbit_binary_generator.erl @@ -193,13 +193,13 @@ generate_array(Array) when is_list(Array) -> short_string_to_binary(String) when is_binary(String) -> Len = size(String), - if Len < 256 -> [<<(size(String)):8>>, String]; + if Len < 256 -> [<<Len:8>>, String]; true -> exit(content_properties_shortstr_overflow) end; short_string_to_binary(String) -> - StringLength = length(String), - if StringLength < 256 -> [<<StringLength:8>>, String]; - true -> exit(content_properties_shortstr_overflow) + Len = length(String), + if Len < 256 -> [<<Len:8>>, String]; + true -> exit(content_properties_shortstr_overflow) end. long_string_to_binary(String) when is_binary(String) -> @@ -239,11 +239,11 @@ encode_properties(Bit, [T | TypeList], [Value | ValueList], FirstShortAcc, Flags encode_property(shortstr, String) -> Len = size(String), - if Len < 256 -> <<Len:8/unsigned, String:Len/binary>>; + if Len < 256 -> <<Len:8, String:Len/binary>>; true -> exit(content_properties_shortstr_overflow) end; encode_property(longstr, String) -> - Len = size(String), <<Len:32/unsigned, String:Len/binary>>; + Len = size(String), <<Len:32, String:Len/binary>>; encode_property(octet, Int) -> <<Int:8/unsigned>>; encode_property(shortint, Int) -> @@ -260,7 +260,7 @@ encode_property(table, Table) -> check_empty_content_body_frame_size() -> %% Intended to ensure that EMPTY_CONTENT_BODY_FRAME_SIZE is %% defined correctly. - ComputedSize = size(list_to_binary(create_frame(?FRAME_BODY, 0, <<>>))), + ComputedSize = iolist_size(create_frame(?FRAME_BODY, 0, <<>>)), if ComputedSize == ?EMPTY_CONTENT_BODY_FRAME_SIZE -> ok; true -> |
