Skip to content

Commit

Permalink
Issue erlang#8099: Convince compiler to use the new 'private append' …
Browse files Browse the repository at this point in the history
…optimisation and ensure we start appending from an empty binary
  • Loading branch information
onno-vos-dev committed Feb 8, 2024
1 parent 26e06f7 commit addcf0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/stdlib/src/binary.erl
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ _Example:_
join([], _Separator) -> <<>>;
join([H], _Separator) -> H;
join([H | T], Separator) ->
join(T, Separator, H).
Acc = <<>>,
join(T, Separator, <<Acc/binary, H/binary>>).
-spec join([binary()], binary(), binary()) -> binary().
join([], _Separator, Acc) -> Acc;
Expand Down

0 comments on commit addcf0a

Please sign in to comment.