aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2017-02-22 16:58:37 +0100
committerBjörn-Egil Dahlberg <[email protected]>2017-02-23 11:50:32 +0100
commitb64d1a7c0ce33dd741a389a3ba88350421883118 (patch)
tree7b20c98f3cd24eda325a3e183e9459a5a53f0200 /lib/stdlib
parent8bed696c8881316a874732d4b7a121cbc77e6a03 (diff)
downloadotp-b64d1a7c0ce33dd741a389a3ba88350421883118.tar.gz
otp-b64d1a7c0ce33dd741a389a3ba88350421883118.tar.bz2
otp-b64d1a7c0ce33dd741a389a3ba88350421883118.zip
stdlib: Use erts_internal:maps_to_list/2 in io_lib_pretty
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/io_lib_pretty.erl12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/stdlib/src/io_lib_pretty.erl b/lib/stdlib/src/io_lib_pretty.erl
index 6ddba8121a..aabccfc5d9 100644
--- a/lib/stdlib/src/io_lib_pretty.erl
+++ b/lib/stdlib/src/io_lib_pretty.erl
@@ -473,19 +473,9 @@ print_length(Term, _D, _RF, _Enc, _Str) ->
print_length_map(_Map, 1, _RF, _Enc, _Str) ->
{"#{...}", 6};
print_length_map(Map, D, RF, Enc, Str) when is_map(Map) ->
- Pairs = print_length_map_pairs(maps_to_list(Map, D), D, RF, Enc, Str),
+ Pairs = print_length_map_pairs(erts_internal:maps_to_list(Map, D), D, RF, Enc, Str),
{{map, Pairs}, list_length(Pairs, 3)}.
-maps_to_list(Map, D) when D < 0; map_size(Map) =< D ->
- maps:to_list(Map);
-maps_to_list(Map, D) ->
- F = fun(_K, _V, {N, L}) when N =:= D ->
- throw(L);
- (K, V, {N, L}) ->
- {N+1, [{K, V} | L]}
- end,
- lists:reverse(catch maps:fold(F, {0, []}, Map)).
-
print_length_map_pairs([], _D, _RF, _Enc, _Str) ->
[];
print_length_map_pairs(_Pairs, 1, _RF, _Enc, _Str) ->