From 93c86d02a58b7340e5a097c60ea9f697351d3020 Mon Sep 17 00:00:00 2001 From: adrianx Date: Thu, 6 Aug 2015 19:59:54 +0800 Subject: [PATCH] Update bson_binary.erl Solve the problem of compile. bson_binary.erl:55: illegal use of variable 'Name' in map --- src/bson_binary.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bson_binary.erl b/src/bson_binary.erl index 49e3719..6ef9b86 100644 --- a/src/bson_binary.erl +++ b/src/bson_binary.erl @@ -52,7 +52,7 @@ get_fields(<<>>, Acc) when is_map(Acc) -> Acc; get_fields(<<>>, Acc) -> lists:reverse(Acc); get_fields(Bin, Acc) when is_map(Acc) -> {Name, Value, Bin1} = get_field(Bin, map), - get_fields(Bin1, Acc#{Name => Value}); + get_fields(Bin1, maps:put(Name,Value,Acc)); get_fields(Bin, Acc) -> {Name, Value, Bin1} = get_field(Bin, normal), get_fields(Bin1, [Value, Name | Acc]). @@ -225,4 +225,4 @@ put_oid(<>) -> Oid. %% @private -spec get_oid(binary()) -> {<<_:96>>, binary()}. -get_oid(<>) -> {Oid, Bin}. \ No newline at end of file +get_oid(<>) -> {Oid, Bin}.