ソースを参照

ft: 代码修改

master
SisMaker 3年前
コミット
13ffa271d1
1個のファイルの変更3行の追加3行の削除
  1. +3
    -3
      src/utils/tpTermCut.erl

+ 3
- 3
src/utils/tpTermCut.erl ファイルの表示

@ -32,7 +32,7 @@ cut(Term, Depth) when is_map(Term) ->
cut(Term, Depth) when is_tuple(Term), Depth =:= ?MaxDepth ->
{'$truncated'};
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, _) ->
Term.
@ -46,8 +46,8 @@ cutList([Term | Tail], Depth, Len, MaxLen, NumStructs, Acc) ->
%% if List was a cons, Tail can be anything
cutList(Tail, Depth, Len + 1, MaxLen, NumStructs + isStruct(Term), [cut(Term, Depth + 1) | Acc])
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([], _, _) ->
[];

読み込み中…
キャンセル
保存