Permalink
Browse files

pokemon_pb: Simpliciation (and speedup) of handling of repeated fields.

  • Loading branch information...
1 parent 762fd0a commit 91be2f7a8336268790d3bc8576b542975b1c8ef6 @esstrifork esstrifork committed Jun 29, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/pokemon_pb.erl
View
@@ -118,7 +118,7 @@ decode(Bytes, Types, Acc) ->
true ->
case lists:keytake(FNum, 1, Acc) of
{value, {FNum, Name, List}, Acc1} ->
- decode(Rest1, Types, [{FNum, Name, lists:reverse([int_to_enum(Type,Value1)|lists:reverse(List)])}|Acc1]);
+ decode(Rest1, Types, [{FNum, Name, List ++ [int_to_enum(Type,Value1)]} | Acc1]);
false ->
decode(Rest1, Types, [{FNum, Name, [int_to_enum(Type,Value1)]}|Acc])
end;

0 comments on commit 91be2f7

Please sign in to comment.