Skip to content

Commit

Permalink
Merge pull request #15 from fycth/master
Browse files Browse the repository at this point in the history
fix merge bug with coalesce
  • Loading branch information
5HT committed Aug 30, 2015
2 parents 636424b + c259ec0 commit e36f767
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/avz.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
sha(Pass) -> crypto:hmac(wf:config(n2o,hmac,sha256),n2o_secret:secret(),wf:to_binary(Pass)).
update({K,V},P) -> wf:setkey(K,1,case P of undefined -> []; _P -> _P end,{K,V}).

coalesce(X,undefined) -> X;
coalesce(_,Y) -> Y.
merge(A,B) -> list_to_tuple([ coalesce(X,Y) || {X,Y} <- lists:zip(tuple_to_list(A),tuple_to_list(B)) ]).

Expand Down

0 comments on commit e36f767

Please sign in to comment.