Commit a94505ff authored by Ilya Prokhorov's avatar Ilya Prokhorov

Shorter syntax used for append lists

parent 73b25056
......@@ -15,15 +15,15 @@ compareHeads(CurrentHead, [NextHead|Tail], [], OriginalList) ->
compareHeads(CurrentHead, [NextHead|Tail], OriginalOutputList, OriginalList) ->
if
CurrentHead < NextHead ->
OutputList = lists:append([OriginalOutputList, [CurrentHead]]),
OutputList = OriginalOutputList ++ [CurrentHead],
compareHeads(NextHead, Tail, OutputList, OriginalList);
true ->
OutputList = lists:append([OriginalOutputList, [NextHead]]),
OutputList = OriginalOutputList ++ [NextHead],
compareHeads(CurrentHead, Tail, OutputList, OriginalList)
end;
compareHeads(CurrentHead, [], OriginalOutputList, OriginalList) ->
OutputList = lists:append([OriginalOutputList, [CurrentHead]]),
OutputList = OriginalOutputList ++ [CurrentHead],
if
OriginalList == OutputList ->
io:format("OutputList: ~w~n", [OutputList]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment