-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Hi,
I noticed that ufp_utils:encode_list/3 will reverse the order of the encoded structs.
Why? I think that is confusing and error prone. At least in OF 1.0 it was important that an output-action was last in an action-list else the actions wasn't performed correctly. Isn't that true also for 1.2 and above ?
Anyway, an alternative implementation could be (completely untested):
encode_list(Encoder, Structs) ->
lists:foldr(fun(Struct, Binaries) ->
StructBin = erlang:apply(Encoder, [Struct]),
<<StructBin/bytes, Binaries/bytes>>
end, <<>>, Structs).
Cheers, Tobbe
Metadata
Metadata
Assignees
Labels
No labels