Reputation: 4993
I have a list of list (AllData
) over which I'm iterating, to get some elements depending on sepc-documentation conditions. Keeping empty tuple {}
or only ok
is causing issues to my list and really I don't want to insert anything to my NewList in else(_->
) block of inner case statement.
Can we skip the else ( _-> ) condition?
Here is my sample code:
lists:foldl(fun(X , {Counter, NewList}) ->
case X:number() of
{Aa, Bb} ->
case X:id() == Aa of
true ->
//Aa matched
{Counter+1, [X:items()|NewList] }
_->
%% I want to skip the code that goes here in inner case statement.
%% Doing anything here showing a wrong output.
%% Keeping empty tuple with counter changing my output like
{Counter+1, [[]|NewList] }
%% I don't have to do anything here at all.
end;
_->
%% Execute some other code and append to J
{Counter+1, [X:items()|NewList] }
end
end,{0, []}, AllData).
Upvotes: 0
Views: 432