Browse Source

Merge pull request #15 from fycth/master

fix merge bug with coalesce
Namdak Tonpa 9 years ago
parent
commit
e36f767ca9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/avz.erl

+ 1 - 0
src/avz.erl

@@ -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)) ]).