Przeglądaj źródła

ft: 代码修改

master
SisMaker 4 lat temu
rodzic
commit
13ffa271d1
1 zmienionych plików z 3 dodań i 3 usunięć
  1. +3
    -3
      src/utils/tpTermCut.erl

+ 3
- 3
src/utils/tpTermCut.erl Wyświetl plik

@ -32,7 +32,7 @@ cut(Term, Depth) when is_map(Term) ->
cut(Term, Depth) when is_tuple(Term), Depth =:= ?MaxDepth -> cut(Term, Depth) when is_tuple(Term), Depth =:= ?MaxDepth ->
{'$truncated'}; {'$truncated'};
cut(Term, Depth) when is_tuple(Term) -> cut(Term, Depth) when is_tuple(Term) ->
list_to_tuple(cutList(tuple_to_list(Term), Depth, 0, ?MaxTupleSize, 0));
list_to_tuple(cutList(tuple_to_list(Term), Depth, 0, ?MaxTupleSize, 0, []));
cut(Term, _) -> cut(Term, _) ->
Term. Term.
@ -46,8 +46,8 @@ cutList([Term | Tail], Depth, Len, MaxLen, NumStructs, Acc) ->
%% if List was a cons, Tail can be anything %% if List was a cons, Tail can be anything
cutList(Tail, Depth, Len + 1, MaxLen, NumStructs + isStruct(Term), [cut(Term, Depth + 1) | Acc]) cutList(Tail, Depth, Len + 1, MaxLen, NumStructs + isStruct(Term), [cut(Term, Depth + 1) | Acc])
end; end;
cutList(Term, Depth, _, _, _, Acc) -> %% if List was a cons
cut(Term, Depth + 1).
cutList(Term, Depth, _, _, _, Acc) -> %% if List was a cons [[[a,a,a|b],1,2,3]|bbbb]
lists:reverse(Acc) ++ cut(Term, Depth + 1).
cutMap([], _, _) -> cutMap([], _, _) ->
[]; [];

Ładowanie…
Anuluj
Zapisz