Permalink
Browse files

Small refactor (a bit stylistic)

  • Loading branch information...
1 parent f9dbbcd commit c28b0d505cdac01171c99c174ef9622327204ac7 @yiannist committed Mar 27, 2014
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/hipe/llvm/hipe_llvm_main.erl
@@ -436,12 +436,11 @@ fix_sdescs([{Offset, Arity} | Rest], SDescs) ->
fix_sdescs(Rest, SDescs);
{?SDESC, Offset, SDesc} ->
{ExnHandler, FrameSize, StkArity, Roots} = SDesc,
- DecRoot = fun(X) -> X - Arity end,
- FixedRoots = lists:map(DecRoot, tuple_to_list(Roots)),
+ FixedRoots = [X - Arity || X <- tuple_to_list(Roots)],
NewRoots =
- case length(FixedRoots) > 0 andalso hd(FixedRoots) >= 0 of
- true -> list_to_tuple(FixedRoots);
- false -> Roots
+ case FixedRoots of
+ [H|_] when H >= 0 -> list_to_tuple(FixedRoots);
+ _ -> Roots
end,
NewSDesc =
{?SDESC, Offset, {ExnHandler, FrameSize - Arity, StkArity, NewRoots}},

0 comments on commit c28b0d5

Please sign in to comment.