Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117832202
D1081.1775303413.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
907 B
Referenced Files
None
Subscribers
None
D1081.1775303413.diff
View Options
diff --git a/src/eimap.erl b/src/eimap.erl
--- a/src/eimap.erl
+++ b/src/eimap.erl
@@ -478,13 +478,10 @@
State#state { command_queue = queue:in_r(Command, State#state.command_queue) }.
inflated(Data, #state{ inflator = undefined }) -> Data;
-inflated(Data, #state{ inflator = Inflator }) -> joined(zlib:inflate(Inflator, Data), <<>>).
+inflated(Data, #state{ inflator = Inflator }) -> iolist_to_binary(zlib:inflate(Inflator, Data)).
deflated(Data, #state{ deflator = undefined }) -> Data;
-deflated(Data, #state{ deflator = Deflator }) -> joined(zlib:deflate(Deflator, Data, sync), <<>>).
-
-joined([], Binary) -> Binary;
-joined([H|Rest], Binary) -> joined(Rest, <<Binary/binary, H/binary>>).
+deflated(Data, #state{ deflator = Deflator }) -> iolist_to_binary(zlib:deflate(Deflator, Data, sync)).
reset_timeout(#state{ command_timeout = Timeout } = State) ->
cancel_timeout(State),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 4, 11:50 AM (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18815811
Default Alt Text
D1081.1775303413.diff (907 B)
Attached To
Mode
D1081: Instead of converting the values from zlib:deflate to binary by hand we can use the iolist_to_binary() function from erlang; this allows us to convert also nested iolists.
Attached
Detach File
Event Timeline