aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/maps.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-05-18 10:29:59 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-05-19 10:15:00 +0200
commit48bd85fdfc0648facfc76078f8556a00b4f6febb (patch)
tree7017abb41a11df7e817e70abd72d3c724dda0dba /lib/stdlib/src/maps.erl
parent3290512efb630ac319dc893a264a16e2aef9fdc1 (diff)
downloadotp-48bd85fdfc0648facfc76078f8556a00b4f6febb.tar.gz
otp-48bd85fdfc0648facfc76078f8556a00b4f6febb.tar.bz2
otp-48bd85fdfc0648facfc76078f8556a00b4f6febb.zip
stdlib: Use lc to implement maps:map/2
Diffstat (limited to 'lib/stdlib/src/maps.erl')
-rw-r--r--lib/stdlib/src/maps.erl5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/stdlib/src/maps.erl b/lib/stdlib/src/maps.erl
index 2913a2ff86..533ff08726 100644
--- a/lib/stdlib/src/maps.erl
+++ b/lib/stdlib/src/maps.erl
@@ -183,10 +183,7 @@ fold(Fun,Init,Map) ->
V2 :: term().
map(Fun,Map) when is_function(Fun, 2), is_map(Map) ->
- maps:from_list(lists:map(fun
- ({K,V}) ->
- {K,Fun(K,V)}
- end,maps:to_list(Map)));
+ maps:from_list([{K,Fun(K,V)}||{K,V}<-maps:to_list(Map)]);
map(Fun,Map) ->
erlang:error(error_type(Map),[Fun,Map]).