Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Small refactor (a bit stylistic)

  • Loading branch information...
commit c28b0d505cdac01171c99c174ef9622327204ac7 1 parent f9dbbcd
@yiannist authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/hipe/llvm/hipe_llvm_main.erl
View
9 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}},
Please sign in to comment.
Something went wrong with that request. Please try again.