summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-09-30 23:18:56 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2011-09-30 23:18:56 +0100
commit725544aee4c3dda7ce4f851c29c3d752d10f280f (patch)
treef32157c1ea1f3f22699379a4892be7c80fc03cfa
parent2f761a511aaaa58b2a49c96c5f2e78cc1f85ff71 (diff)
downloadrabbitmq-server-725544aee4c3dda7ce4f851c29c3d752d10f280f.tar.gz
a few minor tweaks, essentially cosmetic
-rw-r--r--src/rabbit_binary_generator.erl14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rabbit_binary_generator.erl b/src/rabbit_binary_generator.erl
index 75d7edf4..494f3203 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 ->