Skip to content
Browse files

Fix encoding of property lists

Keys and values were swapped.
  • Loading branch information...
1 parent 913b0af commit a2aff62b0dbebd91b1d279f54b5cfd1ceb38d182 @fdmanana fdmanana committed Mar 29, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/json.erl
View
4 src/json.erl
@@ -69,9 +69,9 @@ encode_array_rev([Val | Rest], Acc) ->
encode_proplist_rev([], Acc) ->
[<<"}">> | Acc];
encode_proplist_rev([{Key,Val} | Rest], [<<"{">>]) ->
- encode_proplist_rev(Rest, [{0, Key}, <<":">>, encode_rev(Val), <<"{">>]);
+ encode_proplist_rev(Rest, [encode_rev(Val), <<":">>, {0, Key}, <<"{">>]);
encode_proplist_rev([{Key,Val} | Rest], Acc) ->
- encode_proplist_rev(Rest, [{0, Key}, <<":">>, encode_rev(Val), <<",">> | Acc]).
+ encode_proplist_rev(Rest, [encode_rev(Val), <<":">>, {0, Key}, <<",">> | Acc]).

0 comments on commit a2aff62

Please sign in to comment.
Something went wrong with that request. Please try again.