|
|
@ -1,6 +1,8 @@ |
|
|
|
-module(eFmt). |
|
|
|
|
|
|
|
-import(binary, [split/2, part/3]). |
|
|
|
-import(lists, [keyfind/3, reverse/2]). |
|
|
|
-import(maps, [iterator/1, next/1]). |
|
|
|
|
|
|
|
-compile(inline). |
|
|
|
-compile({inline_size, 128}). |
|
|
@ -237,7 +239,7 @@ writeMap(Map, D, E, BinAcc) -> |
|
|
|
D =:= 1 -> |
|
|
|
<<BinAcc/binary, "...}">>; |
|
|
|
true -> |
|
|
|
writeMapBody(maps:iterator(Map), D, E, BinAcc) |
|
|
|
writeMapBody(iterator(Map), D, E, BinAcc) |
|
|
|
end. |
|
|
|
|
|
|
|
writeMapBody(I, D, E, BinAcc) -> |
|
|
@ -245,7 +247,7 @@ writeMapBody(I, D, E, BinAcc) -> |
|
|
|
D =:= 1 -> |
|
|
|
<<BinAcc/binary, " ...}">>; |
|
|
|
true -> |
|
|
|
case maps:next(I) of |
|
|
|
case next(I) of |
|
|
|
{K, V, none} -> |
|
|
|
KeyTermBin = writeTerm(K, -1, E), |
|
|
|
ValueTermBin = writeTerm(V, -1, E), |
|
|
@ -369,7 +371,7 @@ writeMap(Map, Depth, Width, Encoding, Strings, SumLC, BinAcc) -> |
|
|
|
Depth =:= 1 -> |
|
|
|
<<BinAcc/binary, "...}">>; |
|
|
|
true -> |
|
|
|
writeMapBody(maps:iterator(Map), Depth, Width, Encoding, Strings, SumLC, BinAcc) |
|
|
|
writeMapBody(iterator(Map), Depth, Width, Encoding, Strings, SumLC, BinAcc) |
|
|
|
end. |
|
|
|
|
|
|
|
writeMapBody(I, Depth, Width, Encoding, Strings, SumLC, BinAcc) -> |
|
|
@ -377,7 +379,7 @@ writeMapBody(I, Depth, Width, Encoding, Strings, SumLC, BinAcc) -> |
|
|
|
Depth =:= 1 -> |
|
|
|
<<BinAcc/binary, " ...}">>; |
|
|
|
true -> |
|
|
|
case maps:next(I) of |
|
|
|
case next(I) of |
|
|
|
{K, V, none} -> |
|
|
|
KeyTermBin = writeTerm(K, -1, Width, Encoding, Strings), |
|
|
|
ValueTermBin = writeTerm(V, -1, Width, Encoding, Strings), |
|
|
@ -643,7 +645,7 @@ buildSmall([], CharsLimit, P, S, W, Other, Acc) -> |
|
|
|
[One, Two, Three] -> |
|
|
|
[Three, Two, One]; |
|
|
|
Ret -> |
|
|
|
lists:reverse(Ret, []) |
|
|
|
reverse(Ret, []) |
|
|
|
end |
|
|
|
end; |
|
|
|
buildSmall([OneCA | Cs], CharsLimit, P, S, W, Other, Acc) -> |
|
|
@ -1012,7 +1014,7 @@ charsLen(S) -> |
|
|
|
end. |
|
|
|
|
|
|
|
getOpt(Key, TupleList, Default) -> |
|
|
|
case lists:keyfind(Key, 1, TupleList) of |
|
|
|
case keyfind(Key, 1, TupleList) of |
|
|
|
false -> |
|
|
|
Default; |
|
|
|
ValueTuple -> |
|
|
|