aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2017-02-27 11:04:13 +0100
committerBjörn-Egil Dahlberg <[email protected]>2017-02-27 11:04:13 +0100
commit3202e753383d495bce8008721e94428788d4f400 (patch)
treeb5e86cab9c05ee99f0aa60b3e9b9d5fe999dfda9 /lib/stdlib/src
parent3d0531bcc56810ed8e651dc401bae75a1b227682 (diff)
parentb64d1a7c0ce33dd741a389a3ba88350421883118 (diff)
downloadotp-3202e753383d495bce8008721e94428788d4f400.tar.gz
otp-3202e753383d495bce8008721e94428788d4f400.tar.bz2
otp-3202e753383d495bce8008721e94428788d4f400.zip
Merge branch 'egil/pretty-print-maps-smaller/OTP-14239'
* egil/pretty-print-maps-smaller/OTP-14239: stdlib: Use erts_internal:maps_to_list/2 in io_lib_pretty Update preloaded erts_internal.beam erts: Test erts_internal:maps_to_list/2 erts: Introduce erts_internal:maps_to_list/2
Diffstat (limited to 'lib/stdlib/src')
-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) ->